The type of the response body.
Constructs a new Response object with the given status code, body, and optional behavior.
The HTTP status code of the response.
The body of the response.
Optional
optBehaviour: {Optional behavior configuration for the response.
Optional
disableTransactionID?: booleanOptional
rawBody?: booleanIndicates whether the response body should be treated as raw data.
Optional
shouldStream?: booleanIndicates whether the response should be streamed.
Optional
throwOnErrors?: booleanIndicates whether errors should be thrown for non-successful status codes.
Readonly
disableIndicates whether the transaction ID is disabled.
Readonly
rawIndicates whether the request body should be treated as raw data.
Readonly
shouldDetermines whether streaming is enabled or not.
Readonly
throwA boolean flag indicating whether to throw an error when encountering errors. If set to true, any errors encountered will result in an exception being thrown. If set to false, errors will be logged but the program will continue execution.
Appends a header to the existing headers object.
The key of the header.
The value of the header.
None
Appends a key-value pair into the body object.
The key to append.
The value to append.
None
Builds the response for the given context and transaction.
The context object.
The transaction object.
Optional flag to indicate whether to call the context or not.
Get the status code of the response.
The status code.
Static
BadCreates a BadRequestResponse object with the given parameters.
Optional
msg: stringThe error message.
Optional
errCode: stringThe error code.
Optional
optBody: anyOptional additional body data.
Static
BadCreates a BadRequestResponse object with rollback option.
The error message.
Optional
errCode: stringThe error code.
Optional
optBody: anyOptional body to include in the response.
Static
MissingGenerates a response object for a missing path parameter error.
The name of the missing path parameter.
Static
MissingCreates a response object for a missing query parameter error.
The name of the missing query parameter.
Static
RedirectCreates a redirect response with the specified URL.
The URL to redirect to.
Static
SimpleStatic
SuccessCreates a success response with no content.
A response object with a status code of 204 and no content.
Static
SuccessStatic
SuccessCreates a success response object with a streaming body and specified content type.
The stream object to be used as the response body.
The content type of the response.
Static
UnauthorizedCreates an unauthorized response with the given error message and error code.
The error message.
Optional
errCode: stringThe error code (optional).
Represents a response object with various methods for building and manipulating the response.