slinger 0.2.14

An HTTP Client for Rust designed for hackers.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use slinger::ClientBuilder;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
  let client = ClientBuilder::default().build().unwrap();
  let resp = client
    .get("https://httpbin.org/redirect-to?url=https%3A%2F%2Fhttpbin.org%2Fget")
    .send()
    .await?;
  println!("{:?}", resp.request());
  let record = resp.http_record().unwrap();
  println!("{:?}", record.len());
  Ok(())
}