#http-status #http #status-code #rfc9110

rhttp_status_code

RFC9110 HTTP Status Code

1 stable release

1.0.0 Oct 12, 2023

#18 in #status-code

MIT license

21KB
193 lines

rhttp_status_code

This library provides definition (in number, u16) of HTTP status code, which are defined in rfc9110.

Usage

First, add this in your Cargo.toml:

[dependencies]
rhttp_status_code = { version = "1" }

Then, you can use it in code, like:

fn main() {
    // Note: All constants are u16
    let _a: u16 = rhttp_status_code::OK;
    let _b: u16 = rhttp_status_code::Forbidden;
}

Reference

RFC9110, Session 15: Link


lib.rs:

HTTP status code

rhttp_status_code provides constants for HTTP status code, which have been defined in rfc9110.

Usage

First, add this in your Cargo.toml:

[dependencies]
rhttp_status_code = { version = "1" }

Then, you can use it in code, like:

// Note: All constants are u16
let _ = rhttp_status_code::OK;
let _ = rhttp_status_code::Forbidden;

No runtime deps