isahc 1.8.1

The practical HTTP client that is fun to use.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::io::Cursor;

use isahc::{Body, Request};

fn main() -> Result<(), isahc::Error> {
    let weird_request = Request::head("http://download.opensuse.org/update/tumbleweed/repodata/repomd.xml")
        .body(Body::from_reader(Cursor::new(b"")))?;

    let error = isahc::send(weird_request).unwrap_err();
    eprintln!("{}", error);

    Ok(())
}