http_req_wasi 0.10.2

HTTP client for the WasmEdge network socket API. Derived from the http_req library.
extern crate http_req;
extern crate test;

use http_req::{request::Request, response::Response, uri::Uri};
use std::{convert::TryFrom, fs::File, io::Read, time::Duration};
use test::Bencher;

fn parse_response(b: &mut Bencher) {
    let mut content = Vec::new();
    let mut response = File::open("benches/res.txt").unwrap();
    response.read_to_end(&mut content).unwrap();

    b.iter(|| {
        let mut body = Vec::new();
        Response::try_from(&content, &mut body)

const URI: &str = "";

fn request_send(b: &mut Bencher) {
    b.iter(|| {
        let uri = Uri::try_from(URI).unwrap();
        let timeout = Some(Duration::from_secs(6));
        let mut writer = Vec::new();

        let res = Request::new(&uri)
            .send(&mut writer)


fn parse_uri(b: &mut Bencher) {
    b.iter(|| Uri::try_from(URI));