@@ -416,8 +416,11 @@ the client should send the request body. |
|
|
416 |
416 |
added: v10.0.0 |
417 |
417 |
--> |
418 |
418 |
|
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. |
421 |
424 |
|
422 |
425 |
```js |
423 |
426 |
const http = require('http'); |
@@ -432,8 +435,8 @@ const options = { |
|
|
432 |
435 |
const req = http.request(options); |
433 |
436 |
req.end(); |
434 |
437 |
|
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}`); |
437 |
440 |
}); |
438 |
441 |
``` |
439 |
442 |
|