barehttp 0.1.0

Blocking HTTP/1.1 client for no_std + alloc
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Shared client: headers + query.

fn main() -> Result<(), barehttp::Error> {
  let agent = barehttp::agent();

  let response = agent
    .get("http://example.com")
    .header("X-Example", "1")
    .query("q", "barehttp")
    .call()?;

  println!(
    "{} {}",
    response.status_code(),
    response.to_text()?.chars().take(120).collect::<String>()
  );
  Ok(())
}