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

..03-May-2022-

benches/H03-May-2022-949760

src/H03-May-2022-14,0727,531

tests/H03-May-2022-814650

.cargo-checksum.jsonH A D03-May-202289 11

.cargo_vcs_info.jsonH A D02-Dec-201974 65

.gitignoreH A D17-Apr-201718 32

.travis.ymlH A D02-Dec-2019511 2722

CHANGELOG.mdH A D02-Dec-20194.1 KiB12884

Cargo.tomlH A D02-Dec-20191.6 KiB6854

Cargo.toml.orig-cargoH A D02-Dec-20191,004 5245

LICENSE-APACHEH A D17-Apr-201710.6 KiB202169

LICENSE-MITH A D17-Apr-20171 KiB2622

README.mdH A D10-Jun-20191.6 KiB8155

README.md

1# HTTP
2
3A general purpose library of common HTTP types
4
5[![Build Status](https://travis-ci.org/hyperium/http.svg?branch=master)](https://travis-ci.org/hyperium/http)
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.1"
21```
22
23Next, add this to your crate:
24
25```rust
26extern crate http;
27
28use http::{Request, Response};
29
30fn main() {
31    // ...
32}
33```
34
35## Examples
36
37Create an HTTP request:
38
39```rust
40extern crate http;
41
42use http::Request;
43
44fn main() {
45    let request = Request::builder()
46      .uri("https://www.rust-lang.org/")
47      .header("User-Agent", "awesome/1.0")
48      .body(())
49      .unwrap();
50}
51```
52
53Create an HTTP response:
54
55```rust
56extern crate http;
57
58use http::{Response, StatusCode};
59
60fn main() {
61    let response = Response::builder()
62      .status(StatusCode::MOVED_PERMANENTLY)
63      .header("Location", "https://www.rust-lang.org/install.html")
64      .body(())
65      .unwrap();
66}
67```
68
69# License
70
71Licensed under either of
72
73- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://apache.org/licenses/LICENSE-2.0)
74- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://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