Request
Whenever the page sends a request for a network resource the following sequence of events are emitted by Page:
- Page.onRequest(handler) emitted when the request is issued by the page.
- Page.onResponse(handler) emitted when/if the response status and headers are received for the request.
- Page.onRequestFinished(handler) emitted when the response body is downloaded and the request is complete.
If request fails at some point, then instead of 'requestfinished' event (and possibly instead of 'response' event), the Page.onRequestFailed(handler) event is emitted.
note
HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request will complete with 'requestfinished' event.
If request gets a 'redirect' response, the request is successfully finished with the requestfinished event, and a new request is issued to a redirected url.
Methods
allHeaders
Added in: v1.15An object with all the request HTTP headers associated with this request. The header names are lower-cased.
Usage