Skip to content

Commit c8b663f

Browse files
committed
[http client] reformatted readme
1 parent 1d0e8d1 commit c8b663f

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,27 @@ Basic HTTP/1.0 client.
44

55
## Basic usage
66

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).
810

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.
1013

1114
Interesting events emitted by Request:
1215

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.
1418
* 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.
1621

1722
Interesting events emitted by Response:
1823

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
27+
occured, it is passed as first argument
2228

2329
### Example
2430

0 commit comments

Comments
 (0)