MCPcopy Index your code
hub / github.com/emilk/ehttp

github.com/emilk/ehttp @0.7.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.7.1 ↗ · + Follow
82 symbols 132 edges 13 files 33 documented · 40%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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.

Core symbols most depended-on inside this repo

with_body
called by 5
ehttp/src/types.rs
insert
called by 4
ehttp/src/types.rs
as_str
called by 4
ehttp/src/types.rs
string_from_fetch_error
called by 2
ehttp/src/web.rs
fetch_base
called by 2
ehttp/src/web.rs
get_response_base
called by 2
ehttp/src/web.rs
spawn_future
called by 2
ehttp/src/web.rs
fetch
called by 2
ehttp/src/web.rs

Shape

Method 45
Function 25
Class 6
Enum 6

Languages

Rust100%

Modules by API surface

ehttp/src/types.rs39 symbols
ehttp/src/multipart.rs11 symbols
example_eframe/src/app.rs10 symbols
ehttp/src/web.rs7 symbols
ehttp/src/streaming/web.rs3 symbols
ehttp/src/native.rs3 symbols
ehttp/src/lib.rs3 symbols
ehttp/src/streaming/native.rs2 symbols
example_eframe/src/web.rs1 symbols
example_eframe/src/main.rs1 symbols
ehttp/src/streaming/types.rs1 symbols
ehttp/src/streaming/mod.rs1 symbols

For agents

$ claude mcp add ehttp \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact