• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

patches/25-Apr-2025-3229

src/25-Apr-2025-13,6806,982

tests/25-Apr-2025-1,098886

.cargo-checksum.jsonD25-Apr-20252.5 KiB11

Android.bpD25-Apr-2025907 3733

CHANGELOG.mdD25-Apr-20257.6 KiB206142

Cargo.tomlD25-Apr-20251.4 KiB6149

LICENSED25-Apr-202510.6 KiB202169

LICENSE-APACHED25-Apr-202510.6 KiB202169

LICENSE-MITD25-Apr-20251 KiB2622

METADATAD25-Apr-2025325 1817

MODULE_LICENSE_APACHE2D25-Apr-20250

README.mdD25-Apr-20251.8 KiB8155

cargo_embargo.jsonD25-Apr-202552 54

README.md

1# HTTP
2
3A general purpose library of common HTTP types
4
5[![CI](https://github.com/hyperium/http/workflows/CI/badge.svg)](https://github.com/hyperium/http/actions?query=workflow%3ACI)
6[![Crates.io](https://img.shields.io/crates/v/http.svg)](https://crates.io/crates/http)
7[![Documentation](https://docs.rs/http/badge.svg)][dox]
8
9More information about this crate can be found in the [crate
10documentation][dox].
11
12[dox]: https://docs.rs/http
13
14## Usage
15
16To use `http`, first add this to your `Cargo.toml`:
17
18```toml
19[dependencies]
20http = "0.2"
21```
22
23Next, add this to your crate:
24
25```rust
26use http::{Request, Response};
27
28fn main() {
29    // ...
30}
31```
32
33## Examples
34
35Create an HTTP request:
36
37```rust
38use http::Request;
39
40fn main() {
41    let request = Request::builder()
42      .uri("https://www.rust-lang.org/")
43      .header("User-Agent", "awesome/1.0")
44      .body(())
45      .unwrap();
46}
47```
48
49Create an HTTP response:
50
51```rust
52use http::{Response, StatusCode};
53
54fn main() {
55    let response = Response::builder()
56      .status(StatusCode::MOVED_PERMANENTLY)
57      .header("Location", "https://www.rust-lang.org/install.html")
58      .body(())
59      .unwrap();
60}
61```
62
63# Supported Rust Versions
64
65This project follows the [Tokio MSRV][msrv] and is currently set to `1.49`.
66
67[msrv]: https://github.com/tokio-rs/tokio/#supported-rust-versions
68
69# License
70
71Licensed under either of
72
73- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or https://apache.org/licenses/LICENSE-2.0)
74- MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT)
75
76# Contribution
77
78Unless you explicitly state otherwise, any contribution intentionally submitted
79for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
80dual licensed as above, without any additional terms or conditions.
81