Enumeration of events emitted by ClientRequest

Variables

@:value(cast "abort")@:enum@:implinlineread onlyAbort:ClientRequestEvent<() ‑> Void> = "abort"

Emitted when the request has been aborted by the client. This event is only emitted on the first call to abort().

@:value(cast "connect")@:enum@:implinlineread onlyConnect:ClientRequestEvent<(response:IncomingMessage, socket:Socket, head:Buffer) ‑> Void> = "connect"

Emitted each time a server responds to a request with a CONNECT method. If this event is not being listened for, clients receiving a CONNECT method will have their connections closed.

@:value(cast "continue")@:enum@:implinlineread onlyContinue:ClientRequestEvent<() ‑> Void> = "continue"

Emitted when the server sends a '100 Continue' HTTP response, usually because the request contained 'Expect: 100-continue'. This is an instruction that the client should send the request body.

@:value(cast "information")@:enum@:implinlineread onlyInformation:ClientRequestEvent<InformationEventData ‑> Void> = "information"

Emitted when the server sends a 1xx intermediate response (excluding 101 Upgrade). The listeners of this event will receive an object containing the HTTP version, status code, status message, key-value headers object, and array with the raw header names followed by their respective values.

@:value(cast "response")@:enum@:implinlineread onlyResponse:ClientRequestEvent<IncomingMessage ‑> Void> = "response"

Emitted when a response is received to this request. This event is emitted only once.

@:value(cast "socket")@:enum@:implinlineread onlySocket:ClientRequestEvent<Socket ‑> Void> = "socket"

Emitted after a socket is assigned to this request.

@:value(cast "timeout")@:enum@:implinlineread onlyTimeout:ClientRequestEvent<Socket ‑> Void> = "timeout"

Emitted when the underlying socket times out from inactivity. This only notifies that the socket has been idle. The request must be aborted manually.

See also: request.setTimeout().

@:value(cast "upgrade")@:enum@:implinlineread onlyUpgrade:ClientRequestEvent<(response:IncomingMessage, socket:Socket, head:Buffer) ‑> Void> = "upgrade"

Emitted each time a server responds to a request with an upgrade. If this event is not being listened for and the response status code is 101 Switching Protocols, clients receiving an upgrade header will have their connections closed.