Skip to content

Commit a78d83e

Browse files
authored
docs: clarify response and requestfinished events (microsoft#3532)
* docs: clarify response and requestfinished events * fix typo
1 parent a65b0bb commit a78d83e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/api.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -902,12 +902,12 @@ Emitted when a request fails, for example by timing out.
902902
#### event: 'requestfinished'
903903
- <[Request]>
904904

905-
Emitted when a request finishes successfully.
905+
Emitted when a request finishes successfully after downloading the response body. For a successful response, the sequence of events is `request`, `response` and `requestfinished`.
906906

907907
#### event: 'response'
908908
- <[Response]>
909909

910-
Emitted when a [response] is received.
910+
Emitted when [response] status and headers are received for a request. For a successful response, the sequence of events is `request`, `response` and `requestfinished`.
911911

912912
#### event: 'worker'
913913
- <[Worker]>
@@ -3629,9 +3629,9 @@ Dispatches a `mouseup` event.
36293629

36303630
### class: Request
36313631

3632-
Whenever the page sends a request, such as for a network resource, the following events are emitted by playwright's page:
3632+
Whenever the page sends a request for a network resource the following sequence of events are emitted by [Page]:
36333633
- [`'request'`](#event-request) emitted when the request is issued by the page.
3634-
- [`'response'`](#event-response) emitted when/if the response is received for the request.
3634+
- [`'response'`](#event-response) emitted when/if the response status and headers are received for the request.
36353635
- [`'requestfinished'`](#event-requestfinished) emitted when the response body is downloaded and the request is complete.
36363636

36373637
If request fails at some point, then instead of `'requestfinished'` event (and possibly instead of 'response' event), the [`'requestfailed'`](#event-requestfailed) event is emitted.

0 commit comments

Comments
 (0)