Skip to main content
ClientRequest.prototype.once - http - Node documentation
method ClientRequest.prototype.once

Usage in Deno

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

Parameters

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

Return Type

this
ClientRequest.prototype.once(
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.once(
event: "continue",
listener: () => void,
): this

Parameters

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

Return Type

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

Parameters

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

Return Type

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

Parameters

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

Return Type

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

Parameters

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

Return Type

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

Parameters

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

Return Type

this
ClientRequest.prototype.once(
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.once(
event: "close",
listener: () => void,
): this

Parameters

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

Return Type

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

Parameters

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

Return Type

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

Parameters

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

Return Type

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

Parameters

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

Return Type

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

Parameters

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

Return Type

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

Parameters

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

Return Type

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

Parameters

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

Return Type

this