Thanks to visit codestin.com
Credit goes to lib.rs

#web-server #server #request

mashrl

Minimal and simple HTTP(s) request library (with server)

6 releases

Uses new Rust 2024

0.0.6 Dec 17, 2025
0.0.5 Dec 10, 2025
0.0.4 Sep 7, 2025
0.0.1 Aug 20, 2025

#25 in #request


Used in release-downloader

MIT license

40KB
790 lines

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?

Dependencies

~0.1–5MB
~119K SLoC