Merge pull request #113523 from seans3/content-type-response

Get response content-type
This commit is contained in:
Kubernetes Prow Robot 2022-11-01 22:52:45 -07:00 committed by GitHub
commit ccf57ba09d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1288,6 +1288,14 @@ func (r Result) StatusCode(statusCode *int) Result {
return r 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. // 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 // If the returned object is of type Status and has .Status != StatusSuccess, the
// additional information in Status will be used to enrich the error. // additional information in Status will be used to enrich the error.