Response
Response class represents responses which are received by page.
- response.body()
- response.finished()
- response.frame
- response.headers
- response.json()
- response.ok
- response.request
- response.status
- response.status_text
- response.text()
- response.url
#
response.body()- returns: <[Buffer]>
Returns the buffer with response body.
#
response.finished()Waits for this response to finish, returns failure error if request failed.
#
response.frame- returns: <Frame>
Returns the Frame that initiated this response.
#
response.headersReturns the object with HTTP headers associated with the response. All header names are lower-case.
#
response.json()- returns: <Serializable>
Returns the JSON representation of response body.
This method will throw if the response body is not parsable via JSON.parse
.
#
response.ok- returns: <bool>
Contains a boolean stating whether the response was successful (status in the range 200-299) or not.
#
response.request- returns: <Request>
Returns the matching Request object.
#
response.status- returns: <int>
Contains the status code of the response (e.g., 200 for a success).
#
response.status_text- returns: <str>
Contains the status text of the response (e.g. usually an "OK" for a success).
#
response.text()- returns: <str>
Returns the text representation of response body.
#
response.url- returns: <str>
Contains the URL of the response.