Represents an outgoing HTTP response with common helper methods.
done():any
Finalizes and returns the response.
any
internalServerError():void
Sends a 500 Internal Server Error response.
void
methodNotAllowed():void
Sends a 405 Method Not Allowed response.
void
noContent():void
Sends a 204 No Content response.
void
notFound():void
Sends a 404 Not Found response.
void
redirect(url:string,statusCode?:number):void
Redirects the client to the specified URL.
| Parameter | Type | Description |
|---|---|---|
url | string | The URL to redirect to. |
statusCode? | number | The HTTP status code to use for the redirect. |
void
sendJson(data:any,statusCode?:number):void
Sends a JSON response with an optional status code.
| Parameter | Type | Description |
|---|---|---|
data | any | The data to serialize and send as JSON. |
statusCode? | number | The HTTP status code for the response. |
void
Sets a cookie on the response.
| Parameter | Type | Description |
|---|---|---|
cookieName | string | The name of the cookie to set. |
value | string | The value to assign to the cookie. |
options | CookieOptions | Serialization options for the cookie. |
Promise<void>
IMonoCloudCookieResponse.setCookie
setNoCache():void
Sets cache-control headers to prevent caching.
void