APIResponse
APIResponse class represents responses returned by APIRequestContext.get() and similar methods.
Methodsâ
bodyâ
Added in: v1.16Returns the buffer with response body.
Usage
APIResponse.body();
Returns
disposeâ
Added in: v1.16Disposes the body of this response. If not called then the body will stay in memory until the context closes.
Usage
APIResponse.dispose();
Returns
headersâ
Added in: v1.16An object with all the response HTTP headers associated with this response.
Usage
APIResponse.headers();
Returns
headersArrayâ
Added in: v1.16An 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
okâ
Added in: v1.16Contains a boolean stating whether the response was successful (status in the range 200-299) or not.
Usage
APIResponse.ok();
Returns
statusâ
Added in: v1.16Contains the status code of the response (e.g., 200 for a success).
Usage
APIResponse.status();
Returns
statusTextâ
Added in: v1.16Contains the status text of the response (e.g. usually an "OK" for a success).
Usage
APIResponse.statusText();
Returns
textâ
Added in: v1.16Returns the text representation of response body.
Usage
APIResponse.text();
Returns
urlâ
Added in: v1.16Contains the URL of the response.
Usage
APIResponse.url();
Returns