http_req_wasi 0.11.1

HTTP client for the WasmEdge network socket API. Derived from the http_req library.
Documentation
1
2
3
4
5
6
7
8
9
10
use http_req::request;

fn main() {
    let mut writer = Vec::new(); //container for body of a response
    let res = request::get("http://eu.httpbin.org/get?msg=WasmEdge", &mut writer).unwrap();

    println!("Status: {} {}", res.status_code(), res.reason());
    println!("Headers {}", res.headers());
    println!("{}", String::from_utf8_lossy(&writer));
}