ClientRequest.prototype.on - Node documentation
method ClientRequest.prototype.on

Usage in Deno

import { ClientRequest } from "node:http";
ClientRequest.prototype.on(
event: "abort",
listener: () => void,
): this
Deprecated

Parameters

event: "abort"
listener: () => void

Return Type

this
ClientRequest.prototype.on(
event: "connect",
listener: (
response: IncomingMessage,
socket: Socket,
head: Buffer,
) => void
,
): this

Parameters

event: "connect"
listener: (
response: IncomingMessage,
socket: Socket,
head: Buffer,
) => void

Return Type

this
ClientRequest.prototype.on(
event: "continue",
listener: () => void,
): this

Parameters

event: "continue"
listener: () => void

Return Type

this
ClientRequest.prototype.on(
event: "information",
listener: (info: InformationEvent) => void,
): this

Parameters

event: "information"
listener: (info: InformationEvent) => void

Return Type

this
ClientRequest.prototype.on(
event: "response",
listener: (response: IncomingMessage) => void,
): this

Parameters

event: "response"
listener: (response: IncomingMessage) => void

Return Type

this
ClientRequest.prototype.on(
event: "socket",
listener: (socket: Socket) => void,
): this

Parameters

event: "socket"
listener: (socket: Socket) => void

Return Type

this
ClientRequest.prototype.on(
event: "timeout",
listener: () => void,
): this

Parameters

event: "timeout"
listener: () => void

Return Type

this
ClientRequest.prototype.on(
event: "upgrade",
listener: (
response: IncomingMessage,
socket: Socket,
head: Buffer,
) => void
,
): this

Parameters

event: "upgrade"
listener: (
response: IncomingMessage,
socket: Socket,
head: Buffer,
) => void

Return Type

this
ClientRequest.prototype.on(
event: "close",
listener: () => void,
): this

Parameters

event: "close"
listener: () => void

Return Type

this
ClientRequest.prototype.on(
event: "drain",
listener: () => void,
): this

Parameters

event: "drain"
listener: () => void

Return Type

this
ClientRequest.prototype.on(
event: "error",
listener: (err: Error) => void,
): this

Parameters

event: "error"
listener: (err: Error) => void

Return Type

this
ClientRequest.prototype.on(
event: "finish",
listener: () => void,
): this

Parameters

event: "finish"
listener: () => void

Return Type

this
ClientRequest.prototype.on(
event: "pipe",
listener: (src: stream.Readable) => void,
): this

Parameters

event: "pipe"
listener: (src: stream.Readable) => void

Return Type

this
ClientRequest.prototype.on(
event: "unpipe",
listener: (src: stream.Readable) => void,
): this

Parameters

event: "unpipe"
listener: (src: stream.Readable) => void

Return Type

this
ClientRequest.prototype.on(
event: string | symbol,
listener: (...args: any[]) => void,
): this

Parameters

event: string | symbol
listener: (...args: any[]) => void

Return Type

this