9 releases (4 breaking)

0.5.0 Nov 20, 2024
0.4.2 Oct 31, 2024
0.3.2 Oct 12, 2024
0.3.1 Jul 19, 2024
0.1.0 Jun 5, 2024

#529 in WebAssembly

Download history 45/week @ 2024-08-17 104/week @ 2024-08-24 171/week @ 2024-08-31 150/week @ 2024-09-07 121/week @ 2024-09-14 206/week @ 2024-09-21 109/week @ 2024-09-28 125/week @ 2024-10-05 237/week @ 2024-10-12 261/week @ 2024-10-19 407/week @ 2024-10-26 148/week @ 2024-11-02 161/week @ 2024-11-09 279/week @ 2024-11-16 80/week @ 2024-11-23 25/week @ 2024-11-30

569 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.1–2.1MB
~43K SLoC