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
+13-7Lines changed: 13 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,21 +4,27 @@ Basic HTTP/1.0 client.
4
4
5
5
## Basic usage
6
6
7
-
Requests are prepared using the ``Client#request()`` method. Body can be sent with ``Request#write()``. ``Request#end()`` finishes sending the request (or sends it at all if no body was written).
7
+
Requests are prepared using the ``Client#request()`` method. Body can be
8
+
sent with ``Request#write()``. ``Request#end()`` finishes sending the request
9
+
(or sends it at all if no body was written).
8
10
9
-
Request implements WritableStreamInterface, so a Stream can be piped to it. Response implements ReadableStreamInterface.
11
+
Request implements WritableStreamInterface, so a Stream can be piped to
12
+
it. Response implements ReadableStreamInterface.
10
13
11
14
Interesting events emitted by Request:
12
15
13
-
* response: the response headers were received from the server and successfully parsed. The first argument is a Response instance.
16
+
* response: the response headers were received from the server and successfully
17
+
parsed. The first argument is a Response instance.
14
18
* error: an error occured
15
-
* end: the request is finished. If an error occured, it is passed as first argument. Second and third arguments are the Response and the Request.
19
+
* end: the request is finished. If an error occured, it is passed as first
20
+
argument. Second and third arguments are the Response and the Request.
16
21
17
22
Interesting events emitted by Response:
18
23
19
-
* data: passes a chunk of the response body as first argument
20
-
* error: an error occured
21
-
* end: the response has been fully received. If an error occured, it is passed as first argument
24
+
* data: passes a chunk of the response body as first argument * error:
25
+
an error occured
26
+
* end: the response has been fully received. If an error
0 commit comments