teahttp 0.2.1

a http client for wasm
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use teahttp::{TeaError, TeaHeaderOwner, TeaRequestBuilder, TeaRequestInvoker};

/**

### This example is not meant to be run
It only suppose to test the type system, It will not work because it only implemented for WASM (actually compilable).
*/
#[async_std::main]
async fn main() -> Result<(), TeaError> {
    let _req = teahttp::TeaRequest::get("/api").invoke().await?;
    let some_body = b"Bogus wa Lorem ipsum dolor si amet\r\n";
    let _req = teahttp::TeaRequest::post("/api/submit")
        .header("X-Client", "teahttp")?
        .slice_body(some_body.as_slice())
        .invoke()
        .await?;
    // teahttp::
    Ok(())
}