Simple and lightweight HTTP client for the low level wasmedgewasisocket library. It is to be compiled into WebAssembly bytecode targets and run on the WasmEdge Runtime.
This project is forked and derived from the http_req project created by jayjamesjay.
Basic GET request
```rust use httpreqwasi::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));
} ```
toml
[dependencies]
http_req_wasi = "0.10.0"
The HTTP and HTTPS APIs are the same. But you will need to get the WasmEdge https_req plugin and unzip it into the plugin
directory of your WasmEdge install.
See examples here.