#http #client #request #wasmedge #webassembly

wasmedge_http_req

HTTP client for the WasmEdge network socket API. Derived from the http_req library.

2 unstable releases

new 0.9.0 May 18, 2022
0.8.1 Oct 6, 2021

#962 in Network programming

Download history 12/week @ 2022-01-29 8/week @ 2022-02-05 5/week @ 2022-02-12 12/week @ 2022-02-19 9/week @ 2022-02-26 7/week @ 2022-03-05 13/week @ 2022-03-12 15/week @ 2022-03-19 19/week @ 2022-03-26 8/week @ 2022-04-02 4/week @ 2022-04-09 6/week @ 2022-04-16 10/week @ 2022-04-23 15/week @ 2022-04-30 29/week @ 2022-05-07 56/week @ 2022-05-14

110 downloads per month
Used in wasmedge_quickjs

MIT license

110KB
2K SLoC

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"

lib.rs:

Simple HTTP client with built-in HTTPS support. Currently it's in heavy development and may frequently change.

Example

Basic GET request

use http_req::request;

fn main() {
    let mut writer = Vec::new(); //container for body of a response
    let res = request::get("https://doc.rust-lang.org/", &mut writer).unwrap();

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

Dependencies

~3.5MB
~56K SLoC