← all modules
module

stdlib::http_status

defined in C:\Users\bye45\.glide\bin/src/stdlib/http_status.glide

Return the standard reason phrase for an HTTP status code.

fn fn status_text(code: int) -> string

Return the standard reason phrase for an HTTP status code. Unknown or unassigned codes return "Unknown".

glide
status_text(200);  // "OK"
status_text(404);  // "Not Found"
status_text(599);  // "Unknown"
fn fn is_ok(code: int) -> bool

Return true for HTTP success status codes.

glide
is_ok(204);   // true
is_ok(404);   // false
fn fn is_redirect(code: int) -> bool

Return true for HTTP redirection status codes.

glide
is_redirect(301);  // true
is_redirect(200);  // false
fn fn is_client_error(code: int) -> bool

Return true for HTTP client error status codes.

glide
is_client_error(404);  // true
is_client_error(503);  // false
fn fn is_server_error(code: int) -> bool

Return true for HTTP server error status codes.

glide
is_server_error(503);  // true
is_server_error(404);  // false