status
mach::Response::status
Sets the response status code.
Description
Section titled “Description”Sets the HTTP status code used in the response.
Syntax
Section titled “Syntax”void status(http::StatusCode status);Parameters
Section titled “Parameters”| Parameter | Description |
|---|---|
status |
The status code to set. |
Exceptions
Section titled “Exceptions”| Exception | Condition |
|---|---|
std::invalid_argument |
Thrown if the specified status code is not supported by Mach. |
Thread Safety
Section titled “Thread Safety”This function is not thread-safe.
Example
Section titled “Example”response().status(http::StatusCode::NotFound);See Also
Section titled “See Also”| Name | Description |
|---|---|
StatusCode |
Represents an HTTP status code. |
status |
Returns the response status code. |