Rust HTTP types
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Reynard User c2aa8863c4
Some checks failed
CI / Check MSRV (push) Has been cancelled
CI / WASM (push) Has been cancelled
CI / minimal-versions (push) Has been cancelled
CI / Miri (push) Has been cancelled
CI / semver (push) Has been cancelled
CI / Check Style (push) Has been cancelled
CI / Test beta (push) Has been cancelled
CI / Test stable (push) Has been cancelled
CI / Test nightly (push) Has been cancelled
CI / CI is green (push) Has been cancelled
Update bytes dependency to use git.sly.so
2026-05-11 15:23:32 +02:00
.github tests: update to rand 0.10 (#818) 2026-02-27 10:21:53 -05:00
benches Update bytes dependency to use git.sly.so 2026-05-11 15:23:32 +02:00
fuzz Initial fuzzer set up. (#478) 2021-04-10 08:43:59 -07:00
src docs: fix typo in request builder docs (#831) 2026-04-24 11:03:52 -04:00
tests tests: update to rand 0.10 (#818) 2026-02-27 10:21:53 -05:00
util docs: Fixed encryption/compression typo for 'accept-encoding: identity'. (#695) 2025-03-03 14:58:09 -05:00
.gitignore Initial commit 2017-03-16 08:57:21 -07:00
Cargo.toml Update bytes dependency to use git.sly.so 2026-05-11 15:23:32 +02:00
CHANGELOG.md v1.4.0 2025-11-24 11:56:50 -05:00
LICENSE-APACHE Initial commit 2017-03-16 08:57:21 -07:00
LICENSE-MIT Initial commit 2017-03-16 08:57:21 -07:00
README.md chore: bump MSRV to 1.57 2025-11-19 12:35:52 -05:00

HTTP

A general purpose library of common HTTP types

CI Crates.io Documentation

More information about this crate can be found in the crate documentation.

Usage

To use http, first add this to your Cargo.toml:

[dependencies]
http = "1.0"

Next, add this to your crate:

use http::{Request, Response};

fn main() {
    // ...
}

Examples

Create an HTTP request:

use http::Request;

fn main() {
    let request = Request::builder()
      .uri("https://www.rust-lang.org/")
      .header("User-Agent", "awesome/1.0")
      .body(())
      .unwrap();
}

Create an HTTP response:

use http::{Response, StatusCode};

fn main() {
    let response = Response::builder()
      .status(StatusCode::MOVED_PERMANENTLY)
      .header("Location", "https://www.rust-lang.org/install.html")
      .body(())
      .unwrap();
}

Supported Rust Versions

This project follows the hyper's MSRV policy, though it can be lower, and is currently set to 1.57.

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.