diff options
author | Luigi Pinca <luigipinca@gmail.com> | 2019-03-30 09:55:28 +0100 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2019-04-02 06:19:52 +0200 |
commit | 0a5a762a16224479003dd44b7855b236fc481de9 (patch) | |
tree | 114c6a44275e2e0b0125f187e7c08f44345d481c /doc/api/http.md | |
parent | dada2eba937cc88b323f5251b8e4cccbacee6d5b (diff) | |
download | android-node-v8-0a5a762a16224479003dd44b7855b236fc481de9.tar.gz android-node-v8-0a5a762a16224479003dd44b7855b236fc481de9.tar.bz2 android-node-v8-0a5a762a16224479003dd44b7855b236fc481de9.zip |
doc: improve the doc of the 'information' event
- Add missing argument
- Reword a sentence
- Rename the `res` argument to `info` in the example to avoid confusion
PR-URL: https://github.com/nodejs/node/pull/27009
Fixes: https://github.com/nodejs/node/issues/26905
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Diffstat (limited to 'doc/api/http.md')
-rw-r--r-- | doc/api/http.md | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/doc/api/http.md b/doc/api/http.md index 455195d79f..927e64554e 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -416,8 +416,11 @@ the client should send the request body. added: v10.0.0 --> -Emitted when the server sends a 1xx response (excluding 101 Upgrade). This -event is emitted with a callback containing an object with a status code. +* `info` {Object} + * `statusCode` {integer} + +Emitted when the server sends a 1xx response (excluding 101 Upgrade). The +listeners of this event will receive an object containing the status code. ```js const http = require('http'); @@ -432,8 +435,8 @@ const options = { const req = http.request(options); req.end(); -req.on('information', (res) => { - console.log(`Got information prior to main response: ${res.statusCode}`); +req.on('information', (info) => { + console.log(`Got information prior to main response: ${info.statusCode}`); }); ``` |