Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: improve the doc of the 'information' event #27009

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 7 additions & 4 deletions doc/api/http.md
Expand Up @@ -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}
BridgeAR marked this conversation as resolved.
Show resolved Hide resolved
* `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');
Expand All @@ -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}`);
});
```

Expand Down