Skip to content

Commit 7b37c65

Browse files
lpincaBethGriggs
authored andcommitted
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: #27009 Fixes: #26905 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Signed-off-by: Beth Griggs <Bethany.Griggs@uk.ibm.com>
1 parent f65cb75 commit 7b37c65

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

doc/api/http.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,11 @@ the client should send the request body.
416416
added: v10.0.0
417417
-->
418418

419-
Emitted when the server sends a 1xx response (excluding 101 Upgrade). This
420-
event is emitted with a callback containing an object with a status code.
419+
* `info` {Object}
420+
* `statusCode` {integer}
421+
422+
Emitted when the server sends a 1xx response (excluding 101 Upgrade). The
423+
listeners of this event will receive an object containing the status code.
421424

422425
```js
423426
const http = require('http');
@@ -432,8 +435,8 @@ const options = {
432435
const req = http.request(options);
433436
req.end();
434437

435-
req.on('information', (res) => {
436-
console.log(`Got information prior to main response: ${res.statusCode}`);
438+
req.on('information', (info) => {
439+
console.log(`Got information prior to main response: ${info.statusCode}`);
437440
});
438441
```
439442

0 commit comments

Comments
 (0)