Thanks to visit codestin.com
Credit goes to docs.rs

Crate waki

Crate waki 

Source
Expand description

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

Modules§

header
HTTP header types
multipartmultipart

Structs§

Client
Request
RequestBuilder
Response
ResponseBuilder

Enums§

ErrorCode
These cases are inspired by the IANA HTTP Proxy Error Types: https://www.iana.org/assignments/http-proxy-status/http-proxy-status.xhtml#table-http-proxy-error-types
Method
This type corresponds to HTTP standard Methods.

Attribute Macros§

handler
Export the annotated function as entrypoint of the WASI HTTP component.