wasmedge_http_req

Crates.iowasmedge_http_req
lib.rswasmedge_http_req
version0.9.0
sourcesrc
created_at2021-10-06 18:41:21.899276
updated_at2022-05-18 14:32:17.918147
descriptionHTTP client for the WasmEdge network socket API. Derived from the http_req library.
homepage
repositoryhttps://github.com/second-state/wasmedge_http_req
max_upload_size
id461305
size629,515
hydai (hydai)

documentation

README

wasmedge_http_req

Simple and lightweight HTTP client for the low level wasmedge_wasi_socket 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.

Example

Basic GET request

use wasmedge_http_req::request;

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

    println!("Status: {} {}", res.status_code(), res.reason());
}

How to use:

[dependencies]
wasmedge_http_req  = "0.8.1"
Commit count: 193

cargo fmt