tag | 8b8f2894c0e7dae0523afca80d72e081ca06a51f | |
---|---|---|
tagger | The Android Open Source Project <initial-contribution@android.com> | Tue Apr 23 15:27:32 2024 -0700 |
object | b1bdc52ec261d7931c6318974c08159826cd265a |
Platform Tools Release 35.0.1 (11580240)
commit | b1bdc52ec261d7931c6318974c08159826cd265a | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu Mar 07 02:15:18 2024 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu Mar 07 02:15:18 2024 +0000 |
tree | abe9ec99da51b98bfd7761f40e0107b5f9c974ce | |
parent | 3753088b81002dfbdd3af4ca22e04da4ecae0522 [diff] | |
parent | c3fe4898c1d1564f2d5052d55e21356d852597b0 [diff] |
Snap for 11541002 from c3fe4898c1d1564f2d5052d55e21356d852597b0 to sdk-release Change-Id: I660cfc91c5eedc60fdd40977978155d764f89f66
A general purpose library of common HTTP types
More information about this crate can be found in the crate documentation.
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() { // ... }
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(); }
This project follows the Tokio MSRV and is currently set to 1.49
.
Licensed under either of
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.