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

macro waki-macros

HTTP client and server library for WASI

8 unstable releases (3 breaking)

new 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

#141 in #handler

Download history 203/week @ 2024-07-14 78/week @ 2024-07-21 181/week @ 2024-07-28 77/week @ 2024-08-04 64/week @ 2024-08-11 57/week @ 2024-08-18 103/week @ 2024-08-25 181/week @ 2024-09-01 150/week @ 2024-09-08 121/week @ 2024-09-15 211/week @ 2024-09-22 108/week @ 2024-09-29 254/week @ 2024-10-06 117/week @ 2024-10-13 266/week @ 2024-10-20 427/week @ 2024-10-27

1,075 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