#wasi #http-client #client-server #handler #waki

macro waki-macros

HTTP client and server library for WASI

8 unstable releases (3 breaking)

0.4.2 Oct 31, 2024
0.4.1 Oct 28, 2024
0.3.2 Oct 12, 2024
0.3.1 Jul 19, 2024
0.1.0 Jun 5, 2024

#144 in #handler

Download history 69/week @ 2024-07-22 184/week @ 2024-07-29 78/week @ 2024-08-05 59/week @ 2024-08-12 62/week @ 2024-08-19 100/week @ 2024-08-26 184/week @ 2024-09-02 152/week @ 2024-09-09 121/week @ 2024-09-16 206/week @ 2024-09-23 111/week @ 2024-09-30 266/week @ 2024-10-07 101/week @ 2024-10-14 274/week @ 2024-10-21 430/week @ 2024-10-28 146/week @ 2024-11-04

969 downloads per month
Used in waki

Apache-2.0

4KB

waki

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()
}

Dependencies

~250–700KB
~17K SLoC