Crates.io | teahttp |
lib.rs | teahttp |
version | 0.2.1 |
source | src |
created_at | 2024-08-21 18:42:44.364668 |
updated_at | 2024-08-22 14:58:14.662605 |
description | a http client for wasm |
homepage | https://github.com/hUwUtao/teahttp |
repository | https://github.com/hUwUtao/teahttp |
max_upload_size | |
id | 1346787 |
size | 40,635 |
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!"
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?;