Bug: 288310258

Clone this repo:
  1. af7b9e0 Migrate 25 crates to monorepo by James Farrell · 4 months ago main master
  2. bca2cdc Add patch file. by James Farrell · 4 months ago
  3. afd6f8c Update Android.bp by running cargo_embargo am: deb0576d7b by James Farrell · 6 months ago
  4. deb0576 Update Android.bp by running cargo_embargo by James Farrell · 6 months ago
  5. 5480dc5 Update Android.bp by running cargo_embargo am: b8d090339d am: 54e62a2c99 by James Farrell · 8 months ago android15-tests-dev aml_art_350913340 aml_art_351011240 aml_art_351011340 aml_art_351110180 aml_cbr_350910020 aml_cbr_351011020 aml_doc_350915120 aml_doc_351012120 aml_ext_350912020 aml_hef_350921160 aml_hef_351016140 aml_med_350914000 aml_med_351010060 aml_net_350911020 aml_net_351010000 aml_net_351010020 aml_per_350910080 aml_per_351014000 aml_res_351011000 aml_rkp_350910000 aml_rkp_351011000 aml_sdk_350910000 aml_sta_350911020 aml_tet_350911120 aml_tet_351010220 aml_uwb_350911040 aml_uwb_351011040 aml_wif_350912040 aml_wif_351010040

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 = "0.2"

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 Tokio MSRV and is currently set to 1.49.

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.