mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 02:41:25 +00:00
Merge pull request #113523 from seans3/content-type-response
Get response content-type
This commit is contained in:
commit
ccf57ba09d
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user