7 releases (breaking)

0.6.0 Dec 5, 2025
0.5.0 Feb 16, 2024
0.4.0 Jan 17, 2024
0.3.1 Sep 27, 2023
0.1.0 Sep 3, 2021

#26 in HTTP client

Download history 18870/week @ 2025-09-27 20271/week @ 2025-10-04 20670/week @ 2025-10-11 21275/week @ 2025-10-18 18288/week @ 2025-10-25 19538/week @ 2025-11-01 19647/week @ 2025-11-08 16909/week @ 2025-11-15 19024/week @ 2025-11-22 27637/week @ 2025-11-29 33651/week @ 2025-12-06 35164/week @ 2025-12-13 21494/week @ 2025-12-20 12440/week @ 2025-12-27 42829/week @ 2026-01-03 35884/week @ 2026-01-10

117,843 downloads per month
Used in 110 crates (34 directly)

MIT/Apache

42KB
698 lines

ehttp: a minimal Rust HTTP client for both native and WASM

Latest version Documentation unsafe forbidden Build Status MIT Apache

If you want to do HTTP requests and are targeting both native, web (WASM) and NodeJS (since v18.0), then this is the crate for you!

You can try the web demo here (works in any browser with WASM and WebGL support). Uses eframe.

Usage

let request = ehttp::Request::get("https://www.example.com");
ehttp::fetch(request, move |result: ehttp::Result<ehttp::Response>| {
    println!("Status code: {:?}", result.unwrap().status);
});

The given callback is called when the request is completed. You can communicate the results back to the main thread using something like:

There is also a streaming version under ehttp::fetch::streaming, hidden behind the streaming feature flag.

Dependencies

~0.2–3.5MB
~66K SLoC