Skip to content

Commit

Permalink
Get response content-type
Browse files Browse the repository at this point in the history
Kubernetes-commit: 4ca128d71aa94653927b0e529b746cb7428563b1
  • Loading branch information
seans3 authored and k8s-publishing-bot committed Nov 2, 2022
1 parent 0d57396 commit 8ff4970
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rest/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -1288,6 +1288,14 @@ func (r Result) StatusCode(statusCode *int) Result {
return r
}

// ContentType returns the "Content-Type" response header into the passed
// string, returning the Result for possible chaining. (Only valid if no
// error code was returned.)
func (r Result) ContentType(contentType *string) Result {
*contentType = r.contentType
return r
}

// Into stores the result into obj, if possible. If obj is nil it is ignored.
// If the returned object is of type Status and has .Status != StatusSuccess, the
// additional information in Status will be used to enrich the error.
Expand Down

0 comments on commit 8ff4970

Please sign in to comment.