APIResponse
APIResponse class represents responses returned by ApiRequestContext.GetAsync(url, options) and similar methods.
- ApiResponse.BodyAsync()
- ApiResponse.DisposeAsync()
- ApiResponse.Headers
- ApiResponse.HeadersArray
- ApiResponse.JsonAsync()
- ApiResponse.Ok
- ApiResponse.Status
- ApiResponse.StatusText
- ApiResponse.TextAsync()
- ApiResponse.Url
ApiResponse.BodyAsync()
Added in: v1.16Returns the buffer with response body.
ApiResponse.DisposeAsync()
Added in: v1.16Disposes the body of this response. If not called then the body will stay in memory until the context closes.
ApiResponse.Headers
Added in: v1.16- returns:IDictionary<string, string>># <
An object with all the response HTTP headers associated with this response.
ApiResponse.HeadersArray
Added in: v1.16- returns:IEnumerable<
HttpHeader
>># <
An array with all the request HTTP headers associated with this response. Header names are not lower-cased. Headers with multiple entries, such as Set-Cookie
, appear in the array multiple times.
ApiResponse.JsonAsync()
Added in: v1.16- returns:JsonElement?># <
Returns the JSON representation of response body.
This method will throw if the response body is not parsable via JSON.parse
.
ApiResponse.Ok
Added in: v1.16Contains a boolean stating whether the response was successful (status in the range 200-299) or not.
ApiResponse.Status
Added in: v1.16Contains the status code of the response (e.g., 200 for a success).
ApiResponse.StatusText
Added in: v1.16Contains the status text of the response (e.g. usually an "OK" for a success).
ApiResponse.TextAsync()
Added in: v1.16Returns the text representation of response body.
ApiResponse.Url
Added in: v1.16Contains the URL of the response.