#wasm-edge #http-request #client-request #networking #socket #run-time

wasmedge_http_req

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

2 unstable releases

0.9.0 May 18, 2022
0.8.1 Oct 6, 2021

#299 in HTTP client

Download history 1/week @ 2023-11-27 16/week @ 2023-12-04 56/week @ 2023-12-11 31/week @ 2023-12-18 41/week @ 2023-12-25 23/week @ 2024-01-01 54/week @ 2024-01-08 7/week @ 2024-01-15 26/week @ 2024-01-22 13/week @ 2024-01-29 15/week @ 2024-02-19 41/week @ 2024-02-26 9/week @ 2024-03-04

65 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

~210KB