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

macro waki-macros

HTTP client and server library for WASI

10 releases (4 breaking)

0.5.1 Dec 12, 2024
0.5.0 Nov 20, 2024
0.4.2 Oct 31, 2024
0.3.2 Oct 12, 2024
0.1.0 Jun 5, 2024

#150 in #handler

Download history 189/week @ 2024-09-20 144/week @ 2024-09-27 120/week @ 2024-10-04 221/week @ 2024-10-11 300/week @ 2024-10-18 354/week @ 2024-10-25 203/week @ 2024-11-01 156/week @ 2024-11-08 287/week @ 2024-11-15 106/week @ 2024-11-22 37/week @ 2024-11-29 216/week @ 2024-12-06 156/week @ 2024-12-13 82/week @ 2024-12-20 47/week @ 2024-12-27 225/week @ 2025-01-03

661 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

~230–670KB
~16K SLoC