HttpServerResponse Interface

An HTTP server response object.

Extends

  • Writable

Methods

Name Description
send(body?: any): HttpServerResponse    
set(field: string, value: string): void    
status(code: number): HttpServerResponse    

Inherited methods

Name Inherited from Description
constructor(opts?: WritableOptions): HttpServerResponse Writable  
_destroy(error: Error | null, callback: (error: Error | null) => void): void Writable  
_final(callback: (error?: Error | null) => void): void Writable  
_write(chunk: any, encoding: string, callback: (error?: Error | null) => void): void Writable  
_writev(chunks: Array<object>, callback: (error?: Error | null) => void): void Optional Writable  
addListener(event: "close" = undefined, listener: () => void): this Writable Event emitter
The defined events on documents including:
1.
addListener(event: "drain" = undefined, listener: () => void): this Writable  
addListener(event: "error" = undefined, listener: (err: Error) => void): this Writable  
addListener(event: "finish" = undefined, listener: () => void): this Writable  
addListener(event: "pipe" = undefined, listener: (src: Readable) => void): this Writable  
addListener(event: "unpipe" = undefined, listener: (src: Readable) => void): this Writable  
addListener(event: string | symbol, listener: (...args: any[]) => void): this Writable  
cork(): void Writable  
destroy(error?: Error): void Writable  
emit(event: "close" = undefined): boolean Writable  
emit(event: "drain" = undefined): boolean Writable  
emit(event: "error" = undefined, err: Error): boolean Writable  
emit(event: "finish" = undefined): boolean Writable  
emit(event: "pipe" = undefined, src: Readable): boolean Writable  
emit(event: "unpipe" = undefined, src: Readable): boolean Writable  
emit(event: string | symbol, ...args: any[]): boolean Writable  
end(cb?: () => void): void Writable  
end(chunk: any, cb?: () => void): void Writable  
end(chunk: any, encoding?: string, cb?: () => void): void Writable  
eventNames(): Array<string | symbol> EventEmitter  
getMaxListeners(): number EventEmitter  
listenerCount(type: string | symbol): number EventEmitter  
listeners(event: string | symbol): Function[] EventEmitter  
off(event: string | symbol, listener: (...args: any[]) => void): this EventEmitter  
on(event: "close" = undefined, listener: () => void): this Writable  
on(event: "drain" = undefined, listener: () => void): this Writable  
on(event: "error" = undefined, listener: (err: Error) => void): this Writable  
on(event: "finish" = undefined, listener: () => void): this Writable  
on(event: "pipe" = undefined, listener: (src: Readable) => void): this Writable  
on(event: "unpipe" = undefined, listener: (src: Readable) => void): this Writable  
on(event: string | symbol, listener: (...args: any[]) => void): this Writable  
once(event: "close" = undefined, listener: () => void): this Writable  
once(event: "drain" = undefined, listener: () => void): this Writable  
once(event: "error" = undefined, listener: (err: Error) => void): this Writable  
once(event: "finish" = undefined, listener: () => void): this Writable  
once(event: "pipe" = undefined, listener: (src: Readable) => void): this Writable  
once(event: "unpipe" = undefined, listener: (src: Readable) => void): this Writable  
once(event: string | symbol, listener: (...args: any[]) => void): this Writable  
pipe<T extends WritableStream>(destination: T extends WritableStream, options?: object): T extends WritableStream internal  
prependListener(event: "close" = undefined, listener: () => void): this Writable  
prependListener(event: "drain" = undefined, listener: () => void): this Writable  
prependListener(event: "error" = undefined, listener: (err: Error) => void): this Writable  
prependListener(event: "finish" = undefined, listener: () => void): this Writable  
prependListener(event: "pipe" = undefined, listener: (src: Readable) => void): this Writable  
prependListener(event: "unpipe" = undefined, listener: (src: Readable) => void): this Writable  
prependListener(event: string | symbol, listener: (...args: any[]) => void): this Writable  
prependOnceListener(event: "close" = undefined, listener: () => void): this Writable  
prependOnceListener(event: "drain" = undefined, listener: () => void): this Writable  
prependOnceListener(event: "error" = undefined, listener: (err: Error) => void): this Writable  
prependOnceListener(event: "finish" = undefined, listener: () => void): this Writable  
prependOnceListener(event: "pipe" = undefined, listener: (src: Readable) => void): this Writable  
prependOnceListener(event: "unpipe" = undefined, listener: (src: Readable) => void): this Writable  
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this Writable  
rawListeners(event: string | symbol): Function[] EventEmitter  
removeAllListeners(event?: string | symbol): this EventEmitter  
removeListener(event: "close" = undefined, listener: () => void): this Writable  
removeListener(event: "drain" = undefined, listener: () => void): this Writable  
removeListener(event: "error" = undefined, listener: (err: Error) => void): this Writable  
removeListener(event: "finish" = undefined, listener: () => void): this Writable  
removeListener(event: "pipe" = undefined, listener: (src: Readable) => void): this Writable  
removeListener(event: "unpipe" = undefined, listener: (src: Readable) => void): this Writable  
removeListener(event: string | symbol, listener: (...args: any[]) => void): this Writable  
setDefaultEncoding(encoding: string): this Writable  
setMaxListeners(n: number): this EventEmitter  
uncork(): void Writable  
write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean Writable  
write(chunk: any, encoding?: string, cb?: (error: Error | null | undefined) => void): boolean Writable  
listenerCount(emitter: EventEmitter, event: string | symbol): number Static EventEmitter  

Inherited properties

Name Type Inherited from Description
writable boolean Writable  
writableHighWaterMark number Writable  
writableLength number Writable  
defaultMaxListeners Static number EventEmitter  

Defined in

Last Updated: 08 January, 2020