[go: up one dir, main page]

chttp 0.1.3

The practical HTTP client that is fun to use.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
extern crate chttp;


fn main() {
    let mut options = chttp::Options::default();
    options.preferred_http_version = Some(chttp::http::Version::HTTP_2);

    let client = chttp::Client::builder()
        .options(options)
        .build();

    let mut response = client.get("https://nghttp2.org").unwrap();
    let body = response.body_mut().text().unwrap();
    println!("{}", body);
}