enum abstract ClientRequestEvent<T>(Event<T>)
package js.node.http
to Event<T>
import js.node.http.ClientRequest
Enumeration of events emitted by ClientRequest
Variables
inlineread 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()
.
inlineread 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.
inlineread 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.
inlineread 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.
inlineread onlyResponse:ClientRequestEvent<IncomingMessage ‑> Void> = "response"
Emitted when a response is received to this request. This event is emitted only once.
inlineread onlySocket:ClientRequestEvent<Socket ‑> Void> = "socket"
Emitted after a socket is assigned to this request.
inlineread 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().
inlineread 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.