surf 2.1.0

Surf the web - HTTP client framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
#[async_std::main]
async fn main() -> Result<(), http_types::Error> {
    femme::start(log::LevelFilter::Info)?;

    let uri = "https://httpbin.org/post";
    let data = serde_json::json!({ "name": "chashu" });
    let res = surf::post(uri)
        .body(http_types::Body::from_json(&data)?)
        .await?;
    assert_eq!(res.status(), http_types::StatusCode::Ok);
    Ok(())
}