@@ -52,7 +52,7 @@ per connection (in the case of keep-alive connections).
5252
5353### Event: 'checkContinue'
5454
55- ` function (request, response) {} `
55+ ` function (request, response) { } `
5656
5757Emitted each time a request with an http Expect: 100-continue is received.
5858If this event isn't listened for, the server will automatically respond
@@ -68,7 +68,7 @@ not be emitted.
6868
6969### Event: 'upgrade'
7070
71- ` function (request, socket, head) `
71+ ` function (request, socket, head) { } `
7272
7373Emitted each time a client requests a http upgrade. If this event isn't
7474listened for, then clients requesting an upgrade will have their connections
@@ -84,7 +84,7 @@ sent to the server on that socket.
8484
8585### Event: 'clientError'
8686
87- ` function (exception) {} `
87+ ` function (exception) { } `
8888
8989If a client connection emits an 'error' event - it will forwarded here.
9090
@@ -394,6 +394,10 @@ Options:
394394- ` path ` : Request path. Should include query string and fragments if any.
395395 E.G. ` '/index.html?page=12' `
396396- ` headers ` : An object containing request headers.
397+ - ` agent ` : Controls ` Agent ` behavior. Possible values:
398+ - ` undefined ` (default): use default ` Agent ` for this host and port.
399+ - ` Agent ` object: explicitly use the passed in ` Agent ` .
400+ - ` false ` : explicitly generate a new ` Agent ` for this host and port. ` Agent ` will not be re-used.
397401
398402` http.request() ` returns an instance of the ` http.ClientRequest `
399403class. The ` ClientRequest ` instance is a writable stream. If one needs to
@@ -483,7 +487,7 @@ Options:
483487
484488### Event: 'upgrade'
485489
486- ` function (response, socket, head) `
490+ ` function (response, socket, head) { } `
487491
488492Emitted each time a server responds to a request with an upgrade. If this
489493event isn't being listened for, clients receiving an upgrade header will have
@@ -537,14 +541,6 @@ A client server pair that show you how to listen for the `upgrade` event using `
537541 });
538542
539543
540- ### Event: 'continue'
541-
542- ` function () `
543-
544- Emitted when the server sends a '100 Continue' HTTP response, usually because
545- the request contained 'Expect: 100-continue'. This is an instruction that
546- the client should send the request body.
547-
548544### agent.maxSockets
549545
550546By default set to 5. Determines how many concurrent sockets the agent can have open.
@@ -600,6 +596,14 @@ This is a `Writable Stream`.
600596
601597This is an ` EventEmitter ` with the following events:
602598
599+ ### Event: 'continue'
600+
601+ ` function () { } `
602+
603+ Emitted when the server sends a '100 Continue' HTTP response, usually because
604+ the request contained 'Expect: 100-continue'. This is an instruction that
605+ the client should send the request body.
606+
603607### Event 'response'
604608
605609` function (response) { } `
@@ -646,18 +650,27 @@ The response implements the `Readable Stream` interface.
646650
647651### Event: 'data'
648652
649- ` function (chunk) {} `
653+ ` function (chunk) { } `
650654
651655Emitted when a piece of the message body is received.
652656
653657
654658### Event: 'end'
655659
656- ` function () {} `
660+ ` function () { } `
657661
658662Emitted exactly once for each message. No arguments. After
659663emitted no other events will be emitted on the response.
660664
665+ ### Event: 'close'
666+
667+ ` function (err) { } `
668+
669+ Indicates that the underlaying connection was terminated before
670+ ` end ` event was emitted.
671+ See [ http.ServerRequest] ( #http.ServerRequest ) 's ` 'close' ` event for more
672+ information.
673+
661674### response.statusCode
662675
663676The 3-digit HTTP response status code. E.G. ` 404 ` .
0 commit comments