mashrl

Crates.iomashrl
lib.rsmashrl
version0.0.4
created_at2025-08-20 07:30:03.836723+00
updated_at2025-09-07 14:55:47.971786+00
descriptionMinimal and simple HTTP(s) request library
homepage
repositoryhttps://github.com/kaleidawave/experiments
max_upload_size
id1802954
size36,586
Ben (kaleidawave)

documentation

README

Minimal and simple HTTP(s) request library

Usage:

use mashrl::{HTTP, make_get_request};
use std::io::Read;

fn main() {
    let mut response = make_get_request("httpbin.org", "get", &HTTP::Headers::empty()).unwrap();

    eprintln!("Code {code}", code = response.code.0);

    for (key, value) in &response.headers {
        eprintln!("{key}: {value}");
    }

    let mut content = String::new();
    response.body.read_to_string(&mut content).unwrap();
    eprintln!("{content}");
}

Features

  • Simple to use API
  • Header creation and parsing API
  • Chunked decoding
  • Gzip decompression (under -F decompress)

Future

  • Specify port (default to 443, the standard for internet traffic)
  • Improvements to body handling (auto Content-Length header?)
  • Tracing (under flag)?
  • HTTPS under flag?
Commit count: 1

cargo fmt