File: class-apiresponse.md | Updated: 11/18/2025
On this page
APIResponse class represents responses returned by ApiRequestContext.GetAsync() and similar methods.
Methods
Added in: v1.16 apiResponse.BodyAsync
Returns the buffer with response body.
Usage
await ApiResponse.BodyAsync();
Returns
Added in: v1.16 apiResponse.DisposeAsync
Disposes the body of this response. If not called then the body will stay in memory until the context closes.
Usage
await ApiResponse.DisposeAsync();
Returns
Added in: v1.16 apiResponse.Headers
An object with all the response HTTP headers associated with this response.
Usage
ApiResponse.Headers
Returns
Added in: v1.16 apiResponse.HeadersArray
An array with all the response 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.
Usage
ApiResponse.HeadersArray
Returns
HttpHeader>#
Added in: v1.16 apiResponse.JsonAsync
Returns the JSON representation of response body.
This method will throw if the response body is not parsable via JSON.parse.
Usage
await ApiResponse.JsonAsync();
Returns
Added in: v1.16 apiResponse.Ok
Contains a boolean stating whether the response was successful (status in the range 200-299) or not.
Usage
ApiResponse.Ok
Returns
Added in: v1.16 apiResponse.Status
Contains the status code of the response (e.g., 200 for a success).
Usage
ApiResponse.Status
Returns
Added in: v1.16 apiResponse.StatusText
Contains the status text of the response (e.g. usually an "OK" for a success).
Usage
ApiResponse.StatusText
Returns
Added in: v1.16 apiResponse.TextAsync
Returns the text representation of response body.
Usage
await ApiResponse.TextAsync();
Returns
Added in: v1.16 apiResponse.Url
Contains the URL of the response.
Usage
ApiResponse.Url
Returns