Crates.io | waki |
lib.rs | waki |
version | 0.5.0 |
source | src |
created_at | 2024-06-05 08:32:23.853581 |
updated_at | 2024-11-20 03:07:03.157878 |
description | HTTP client and server library for WASI |
homepage | |
repository | https://github.com/wacker-dev/waki |
max_upload_size | |
id | 1262555 |
size | 191,294 |
HTTP client and server library for WASI.
Send a request:
let resp = Client::new()
.post("https://httpbin.org/post")
.connect_timeout(Duration::from_secs(5))
.send()?;
println!("status code: {}", resp.status_code());
Writing an HTTP component:
use waki::{handler, ErrorCode, Request, Response};
#[handler]
fn hello(req: Request) -> Result<Response, ErrorCode> {
Response::builder().body(b"Hello, WASI!").build()
}