Name: http
Owner: hyperium
Description: Rust HTTP types
Created: 2017-03-14 18:21:23.0
Updated: 2018-05-24 21:30:39.0
Pushed: 2018-05-24 21:30:37.0
Size: 1373
Language: Rust
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
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
:
endencies]
= "0.1"
Next, add this to your crate:
rn crate http;
http::{Request, Response};
ain() {
// ...
Create an HTTP request:
rn crate http;
http::Request;
ain() {
let request = Request::builder()
.uri("https://www.rust-lang.org/")
.header("User-Agent", "awesome/1.0")
.body(())
.unwrap();
Create an HTTP response:
rn crate http;
http::{Response, StatusCode};
ain() {
let response = Response::builder()
.status(StatusCode::MOVED_PERMANENTLY)
.header("Location", "https://www.rust-lang.org/install.html")
.body(())
.unwrap();
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.