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.
OptionaloptBehaviour: {Optional behavior configuration for the response.
OptionaldisableTransactionID?: booleanOptionalrawBody?: booleanIndicates whether the response body should be treated as raw data.
OptionalshouldStream?: booleanIndicates whether the response should be streamed.
OptionalthrowOnErrors?: booleanIndicates whether errors should be thrown for non-successful status codes.
ReadonlydisableIndicates whether the transaction ID is disabled.
ReadonlyrawIndicates whether the request body should be treated as raw data.
ReadonlyshouldDetermines whether streaming is enabled or not.
ReadonlythrowA 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.
StaticBadCreates a BadRequestResponse object with the given parameters.
Optionalmsg: stringThe error message.
OptionalerrCode: stringThe error code.
OptionaloptBody: anyOptional additional body data.
StaticBadCreates a BadRequestResponse object with rollback option.
The error message.
OptionalerrCode: stringThe error code.
OptionaloptBody: anyOptional body to include in the response.
StaticMissingGenerates a response object for a missing path parameter error.
The name of the missing path parameter.
StaticMissingCreates a response object for a missing query parameter error.
The name of the missing query parameter.
StaticRedirectCreates a redirect response with the specified URL.
The URL to redirect to.
StaticSimpleStaticSuccessCreates a success response with no content.
A response object with a status code of 204 and no content.
StaticSuccessStaticSuccessCreates 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.
StaticUnauthorizedCreates an unauthorized response with the given error message and error code.
The error message.
OptionalerrCode: stringThe error code (optional).
Represents a response object with various methods for building and manipulating the response.