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

#546 in WebAssembly

Download history 193/week @ 2024-09-20 140/week @ 2024-09-27 119/week @ 2024-10-04 217/week @ 2024-10-11 293/week @ 2024-10-18 343/week @ 2024-10-25 198/week @ 2024-11-01 155/week @ 2024-11-08 283/week @ 2024-11-15 103/week @ 2024-11-22 37/week @ 2024-11-29 219/week @ 2024-12-06 154/week @ 2024-12-13 82/week @ 2024-12-20 50/week @ 2024-12-27 223/week @ 2025-01-03

664 downloads per month

Apache-2.0

43KB
945 lines

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

lib.rs:

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

~1.2–2.2MB
~43K SLoC