uce/site/doc/pages/set_status.txt

21 lines
603 B
Plaintext

:sig
void context.set_status(s32 code, String reason = "")
:params
code : HTTP status code
reason : optional reason phrase override
:see
0_Request
>types
:content
Sets the current request status line and mirrors the numeric status into `context.flags.status`.
When `reason` is omitted, UCE fills in a standard reason phrase for common HTTP status codes such as `200`, `302`, `400`, `404`, and `500`.
Related:
- PHP: `http_response_code()` and explicit status-line header control
- JavaScript / Node.js: `res.status(...)`, `Response` init status, or low-level status assignment on an HTTP response