Module hyper::client
[−]
[src]
HTTP Client
Usage
The Client
API is designed for most people to make HTTP requests.
It utilizes the lower level Request
API.
GET
let mut client = Client::new(); let res = client.get("http://example.domain").send().unwrap(); assert_eq!(res.status, hyper::Ok);
The returned value is a Response
, which provides easy access to
the status
, the headers
, and the response body via the Read
trait.
POST
let mut client = Client::new(); let res = client.post("http://example.domain") .body("foo=bar") .send() .unwrap(); assert_eq!(res.status, hyper::Ok);
Reexports
pub use self::pool::Pool; |
pub use self::request::Request; |
pub use self::response::Response; |
Modules
pool |
Client Connection Pooling |
request |
Client Requests |
response |
Client Responses |
Structs
Client |
A Client to use additional features with Requests. |
RequestBuilder |
Options for an individual Request. |
Enums
Body |
An enum of possible body types for a Request. |
RedirectPolicy |
Behavior regarding how to handle redirects within a Client. |
Traits
IntoUrl |
A helper trait to convert common objects into a Url. |