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

macro waki-macros

HTTP client and server library for WASI

10 releases (4 breaking)

new 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

#149 in #handler

Download history 67/week @ 2024-08-21 102/week @ 2024-08-28 203/week @ 2024-09-04 152/week @ 2024-09-11 127/week @ 2024-09-18 189/week @ 2024-09-25 121/week @ 2024-10-02 250/week @ 2024-10-09 258/week @ 2024-10-16 263/week @ 2024-10-23 301/week @ 2024-10-30 166/week @ 2024-11-06 115/week @ 2024-11-13 297/week @ 2024-11-20 43/week @ 2024-11-27 49/week @ 2024-12-04

547 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

~220–660KB
~16K SLoC