Constructor
new RequestResponse(server, baseResponse) → {RequestResponse}
Parameters:
| Name | Type | Description |
|---|---|---|
server |
OrigamiServer | The server that instantiated this response |
baseResponse |
ServerResponse | The original server response object |
- Source:
Returns:
- Type
- RequestResponse
Members
buffer
Shorthand to turn the response into a Buffer.
- Source:
error
Shorthand for creating a request error. This is meant for client errors, please throw instead for backend errors.
- Source:
getStreamedResponse
Get a StreamedResponse object for this request, allowing you to write a response manually in chunks.
- Source:
setHead
Set a response header.
- Source:
setHeadMany
Shorthand to set multiple headers at a time
- Source:
setStatus
Set the HTTP status of the response.
- Source:
setType
Set the MIME type of the response.
- Source:
write
Write something to the response body.
- Source: