teahttp

Crates.ioteahttp
lib.rsteahttp
version0.2.1
sourcesrc
created_at2024-08-21 18:42:44.364668
updated_at2024-08-22 14:58:14.662605
descriptiona http client for wasm
homepagehttps://github.com/hUwUtao/teahttp
repositoryhttps://github.com/hUwUtao/teahttp
max_upload_size
id1346787
size40,635
stdpi (hUwUtao)

documentation

README

teahttpd

an unsophisticated (fetch wrapper) http client for wasm

ok pls propose something because this ductape plane is running on a motive of "should works, would works and it works!"

how to use

    let _res: web_sys::Request = teahttp::TeaRequest::get("/api/something")
        .header("Accept", "application/json")?
        .clone()
        .slice_body(&encoded)
        .invoke()
        .await?;

    let _res: web_sys::Request = teahttp::TeaRequest::post("/api/upload")
        .header("Content-Type", "application/octet-stream")?
        .header("Content-Length", &encoded.len().to_string())?
        .clone()
        .slice_body(&encoded)
        .invoke()
        .await?;

todo if needed

  • better error handling
  • serde
  • umm diy and wrap this?
Commit count: 0

cargo fmt