Crate ehttp

source ·
Expand description

Minimal HTTP client for both native and WASM.

Example:

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:

§Feature flags

  • json — Support json fetch
  • multipart — Support multipart fetch
  • native-async — Support fetch_async on native
  • streaming — Support streaming fetch

Modules§

  • Multipart HTTP request for both native and WASM.
  • Streaming HTTP client for both native and WASM.

Structs§

Functions§

  • Performs an HTTP request and calls the given callback when done.
  • Performs an async HTTP request.
  • Performs a HTTP request and blocks the thread until it is done.
  • headersDeprecated

Type Aliases§

  • A description of an error.
  • A type-alias for Result<T, ehttp::Error>.