hyperium/http

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

Homepage:

Size: 1373

Language: Rust

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

HTTP

A general purpose library of common HTTP types

Build Status 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:

endencies]
 = "0.1"

Next, add this to your crate:

rn crate http;

http::{Request, Response};

ain() {
// ...

Examples

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();

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.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.