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
15
16
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
  #[cfg(feature = "cookie")]
  {
    use slinger::ClientBuilder;
    let client = ClientBuilder::default().cookie_store(true).build().unwrap();
    let resp = client
      .get("http://httpbin.org/cookies/set/key/value")
      .send()
      .await?;
    println!("{:?}", resp.text());
    let record = resp.http_record().unwrap();
    println!("{:?}", record.len());
  }
  Ok(())
}