The status_code component

A simple component to set the HTTP status code for the response. This can be used to indicate the result of the request, such as 200 for success, 404 for not found, or 500 for server error.

    The status code should be set according to the HTTP standard status codes.

    This component should be used when you need to explicitly set the status code of the HTTP response.
    

Top-level parameters

status

REQUIRED. The HTTP status code to be set for the response. This should be an integer value representing a valid HTTP status code.

Examples

Set the HTTP status code to 404, indicating that the requested resource was not found. Useful in combination with 404.sql files:

select 'status_code' as component, 404 as status;

See also: other components