HTTP::STATUS 1g 2024-03-22 laplante@plcb.ca GOWEB/HTTP


author: laplante@plcb.ca date: 2024-03-22 title: “HTTP::STATUS Function” version: 1.0.0 section: 1g

category: GOWEB/HTTP

Name

http::status — Set the HTTP status code

Synopsis

http::status(code)

Description

The http::status function sets the HTTP response status code. It supports all standard codes defined in RFCs, including informational, success, redirection, client error, and server error responses.

Predefined Status Codes

Some of the predefined constants include:

For the complete list, see the official HTTP RFC references (e.g., RFC 9110, RFC 4918, RFC 6585).

Examples

// Set response status to 401 Unauthorized
status(http::StatusUnauthorized);

// Set response status to 404 Not Found
status(http::StatusNotFound);

Author

laplante@plcb.ca

See also

Version