зеркало из https://github.com/mozilla/gecko-dev.git
fa6c2a6c1a
Differential Revision: https://phabricator.services.mozilla.com/D58766 --HG-- rename : third_party/rust/bytes/.cargo-checksum.json => third_party/rust/bytes-0.4.9/.cargo-checksum.json rename : third_party/rust/bytes/CHANGELOG.md => third_party/rust/bytes-0.4.9/CHANGELOG.md rename : third_party/rust/bytes/Cargo.toml => third_party/rust/bytes-0.4.9/Cargo.toml rename : third_party/rust/bytes/README.md => third_party/rust/bytes-0.4.9/README.md rename : third_party/rust/bytes/benches/bytes.rs => third_party/rust/bytes-0.4.9/benches/bytes.rs rename : third_party/rust/bytes/ci/before_deploy.ps1 => third_party/rust/bytes-0.4.9/ci/before_deploy.ps1 rename : third_party/rust/bytes/ci/before_deploy.sh => third_party/rust/bytes-0.4.9/ci/before_deploy.sh rename : third_party/rust/bytes/ci/install.sh => third_party/rust/bytes-0.4.9/ci/install.sh rename : third_party/rust/bytes/ci/script.sh => third_party/rust/bytes-0.4.9/ci/script.sh rename : third_party/rust/bytes/ci/tsan => third_party/rust/bytes-0.4.9/ci/tsan rename : third_party/rust/bytes/src/buf/buf.rs => third_party/rust/bytes-0.4.9/src/buf/buf.rs rename : third_party/rust/bytes/src/buf/buf_mut.rs => third_party/rust/bytes-0.4.9/src/buf/buf_mut.rs rename : third_party/rust/bytes/src/buf/chain.rs => third_party/rust/bytes-0.4.9/src/buf/chain.rs rename : third_party/rust/bytes/src/buf/from_buf.rs => third_party/rust/bytes-0.4.9/src/buf/from_buf.rs rename : third_party/rust/bytes/src/buf/into_buf.rs => third_party/rust/bytes-0.4.9/src/buf/into_buf.rs rename : third_party/rust/bytes/src/buf/iter.rs => third_party/rust/bytes-0.4.9/src/buf/iter.rs rename : third_party/rust/bytes/src/buf/mod.rs => third_party/rust/bytes-0.4.9/src/buf/mod.rs rename : third_party/rust/bytes/src/buf/reader.rs => third_party/rust/bytes-0.4.9/src/buf/reader.rs rename : third_party/rust/bytes/src/buf/take.rs => third_party/rust/bytes-0.4.9/src/buf/take.rs rename : third_party/rust/bytes/src/buf/writer.rs => third_party/rust/bytes-0.4.9/src/buf/writer.rs rename : third_party/rust/bytes/src/bytes.rs => third_party/rust/bytes-0.4.9/src/bytes.rs rename : third_party/rust/bytes/src/debug.rs => third_party/rust/bytes-0.4.9/src/debug.rs rename : third_party/rust/bytes/src/lib.rs => third_party/rust/bytes-0.4.9/src/lib.rs rename : third_party/rust/bytes/src/serde.rs => third_party/rust/bytes-0.4.9/src/serde.rs rename : third_party/rust/bytes/tests/test_buf.rs => third_party/rust/bytes-0.4.9/tests/test_buf.rs rename : third_party/rust/bytes/tests/test_buf_mut.rs => third_party/rust/bytes-0.4.9/tests/test_buf_mut.rs rename : third_party/rust/bytes/tests/test_bytes.rs => third_party/rust/bytes-0.4.9/tests/test_bytes.rs rename : third_party/rust/bytes/tests/test_chain.rs => third_party/rust/bytes-0.4.9/tests/test_chain.rs rename : third_party/rust/bytes/tests/test_debug.rs => third_party/rust/bytes-0.4.9/tests/test_debug.rs rename : third_party/rust/bytes/tests/test_from_buf.rs => third_party/rust/bytes-0.4.9/tests/test_from_buf.rs rename : third_party/rust/bytes/tests/test_iter.rs => third_party/rust/bytes-0.4.9/tests/test_iter.rs rename : third_party/rust/bytes/tests/test_serde.rs => third_party/rust/bytes-0.4.9/tests/test_serde.rs rename : third_party/rust/bytes/tests/test_take.rs => third_party/rust/bytes-0.4.9/tests/test_take.rs rename : third_party/rust/bytes/benches/bytes.rs => third_party/rust/bytes/benches/bytes_mut.rs rename : third_party/rust/bytes/src/buf/buf.rs => third_party/rust/bytes/src/buf/buf_impl.rs rename : third_party/rust/bytes/src/buf/chain.rs => third_party/rust/bytes/src/buf/ext/chain.rs rename : third_party/rust/bytes/src/buf/reader.rs => third_party/rust/bytes/src/buf/ext/reader.rs rename : third_party/rust/bytes/src/buf/take.rs => third_party/rust/bytes/src/buf/ext/take.rs rename : third_party/rust/bytes/src/buf/writer.rs => third_party/rust/bytes/src/buf/ext/writer.rs rename : third_party/rust/http/.cargo-checksum.json => third_party/rust/http-0.1.17/.cargo-checksum.json rename : third_party/rust/http/CHANGELOG.md => third_party/rust/http-0.1.17/CHANGELOG.md rename : third_party/rust/http/Cargo.toml => third_party/rust/http-0.1.17/Cargo.toml rename : third_party/rust/http/benches/header_map/basic.rs => third_party/rust/http-0.1.17/benches/header_map/basic.rs rename : third_party/rust/http/benches/header_map/mod.rs => third_party/rust/http-0.1.17/benches/header_map/mod.rs rename : third_party/rust/http/benches/header_map/vec_map.rs => third_party/rust/http-0.1.17/benches/header_map/vec_map.rs rename : third_party/rust/http/benches/header_value.rs => third_party/rust/http-0.1.17/benches/header_value.rs rename : third_party/rust/http/benches/uri.rs => third_party/rust/http-0.1.17/benches/uri.rs rename : third_party/rust/http/src/byte_str.rs => third_party/rust/http-0.1.17/src/byte_str.rs rename : third_party/rust/http/src/convert.rs => third_party/rust/http-0.1.17/src/convert.rs rename : third_party/rust/http/src/error.rs => third_party/rust/http-0.1.17/src/error.rs rename : third_party/rust/http/src/extensions.rs => third_party/rust/http-0.1.17/src/extensions.rs rename : third_party/rust/http/src/header/map.rs => third_party/rust/http-0.1.17/src/header/map.rs rename : third_party/rust/http/src/header/mod.rs => third_party/rust/http-0.1.17/src/header/mod.rs rename : third_party/rust/http/src/header/name.rs => third_party/rust/http-0.1.17/src/header/name.rs rename : third_party/rust/http/src/header/value.rs => third_party/rust/http-0.1.17/src/header/value.rs rename : third_party/rust/http/src/lib.rs => third_party/rust/http-0.1.17/src/lib.rs rename : third_party/rust/http/src/method.rs => third_party/rust/http-0.1.17/src/method.rs rename : third_party/rust/http/src/request.rs => third_party/rust/http-0.1.17/src/request.rs rename : third_party/rust/http/src/response.rs => third_party/rust/http-0.1.17/src/response.rs rename : third_party/rust/http/src/status.rs => third_party/rust/http-0.1.17/src/status.rs rename : third_party/rust/http/src/uri/authority.rs => third_party/rust/http-0.1.17/src/uri/authority.rs rename : third_party/rust/http/src/uri/builder.rs => third_party/rust/http-0.1.17/src/uri/builder.rs rename : third_party/rust/http/src/uri/mod.rs => third_party/rust/http-0.1.17/src/uri/mod.rs rename : third_party/rust/http/src/uri/path.rs => third_party/rust/http-0.1.17/src/uri/path.rs rename : third_party/rust/http/src/uri/port.rs => third_party/rust/http-0.1.17/src/uri/port.rs rename : third_party/rust/http/src/uri/scheme.rs => third_party/rust/http-0.1.17/src/uri/scheme.rs rename : third_party/rust/http/src/uri/tests.rs => third_party/rust/http-0.1.17/src/uri/tests.rs rename : third_party/rust/http/src/version.rs => third_party/rust/http-0.1.17/src/version.rs rename : third_party/rust/http/tests/header_map.rs => third_party/rust/http-0.1.17/tests/header_map.rs rename : third_party/rust/http/tests/header_map_fuzz.rs => third_party/rust/http-0.1.17/tests/header_map_fuzz.rs rename : third_party/rust/http/tests/status_code.rs => third_party/rust/http-0.1.17/tests/status_code.rs extra : moz-landing-system : lando |
||
---|---|---|
.. | ||
benches | ||
src | ||
tests | ||
.cargo-checksum.json | ||
CHANGELOG.md | ||
Cargo.toml | ||
LICENSE-APACHE | ||
LICENSE-MIT | ||
README.md |
README.md
HTTP
A general purpose library of common HTTP types
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.1"
Next, add this to your crate:
extern crate http;
use http::{Request, Response};
fn main() {
// ...
}
Examples
Create an HTTP request:
extern crate http;
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:
extern crate http;
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();
}
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
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.