Class: ExpressHttpResponse
Represents an HTTP response, providing methods to set status codes, headers, cookies, and send various types of responses such as JSON, files, or streams. Also includes methods to clear cookies and check if the response has been committed.
Implements
Constructors
Constructor
new ExpressHttpResponse(
response):ExpressHttpResponse
Parameters
response
Response
Returns
ExpressHttpResponse
Methods
clearCookie()
clearCookie(
name,options?):this
Parameters
name
string
options?
CookieOptions
Returns
this
Implementation of
cookie()
cookie(
name,value,options?):this
Parameters
name
string
value
string
options?
CookieOptions
Returns
this
Implementation of
end()
end():
void
Returns
void
Implementation of
file()
file(
filePath):void
Parameters
filePath
string
Returns
void
Implementation of
header()
header(
name,value):this
Parameters
name
string
value
string
Returns
this
Implementation of
isCommitted()
isCommitted():
boolean
Returns
boolean
Implementation of
json()
json(
body?):void
Parameters
body?
any
Returns
void
Implementation of
send()
send(
body?):void
Parameters
body?
any
Returns
void
Implementation of
status()
status(
code):this
Parameters
code
number
Returns
this
Implementation of
stream()
stream(
stream):void
Parameters
stream
ReadableStream
Returns
void