You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-8Lines changed: 15 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,25 +22,32 @@ Calling this method finalizes the outgoing request body (which may be empty).
22
22
Data will be buffered until the underlying connection is established, at which
23
23
point buffered data will be sent and all further data will be ignored.
24
24
25
+
The `Request#close()` method can be used to
26
+
forefully close sending the request.
27
+
Unlike the `end()` method, this method discards any buffers and closes the
28
+
underlying connection.
29
+
25
30
Request implements WritableStreamInterface, so a Stream can be piped to it.
26
31
Interesting events emitted by Request:
27
32
28
33
*`response`: The response headers were received from the server and successfully
29
34
parsed. The first argument is a Response instance.
30
35
*`drain`: The outgoing buffer drained and the response is ready to accept more
31
36
data for the next `write()` call.
32
-
*`error`: An error occurred.
33
-
*`end`: The request is finished. If an error occurred, it is passed as first
34
-
argument. Second and third arguments are the Response and the Request.
37
+
*`error`: An error occurred, an `Exception` is passed as first argument.
38
+
*`close`: The request is closed. If an error occurred, this event will be
39
+
preceeded by an `error` event.
35
40
36
41
Response implements ReadableStreamInterface.
37
42
Interesting events emitted by Response:
38
43
39
-
*`data`: Passes a chunk of the response body as first argument and a Response
40
-
object itself as second argument. When a response encounters a chunked encoded response it will parse it transparently for the user of `Response` and removing the `Transfer-Encoding` header.
41
-
*`error`: An error occurred.
42
-
*`end`: The response has been fully received. If an error
43
-
occurred, it is passed as first argument.
44
+
*`data`: Passes a chunk of the response body as first argument.
45
+
When a response encounters a chunked encoded response it will parse it
46
+
transparently for the user and removing the `Transfer-Encoding` header.
47
+
*`error`: An error occurred, an `Exception` is passed as first argument.
48
+
*`end`: The response has been fully received.
49
+
*`close`: The response is closed. If an error occured, this event will be
0 commit comments