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

#482 in WebAssembly

Download history 66/week @ 2024-11-24 40/week @ 2024-12-01 304/week @ 2024-12-08 117/week @ 2024-12-15 50/week @ 2024-12-22 63/week @ 2024-12-29 245/week @ 2025-01-05 220/week @ 2025-01-12 291/week @ 2025-01-19 183/week @ 2025-01-26 163/week @ 2025-02-02 177/week @ 2025-02-09 335/week @ 2025-02-16 191/week @ 2025-02-23 220/week @ 2025-03-02 256/week @ 2025-03-09

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