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
Multipart HTTP request for both native and WASM.
streaming
Streaming HTTP client for both native and WASM.

Structs§

Headers
Headers in a Request or Response.
PartialResponse
An HTTP response status line and headers used for the streaming API.
Request
A simple HTTP request.
Response
Response from a completed HTTP request.

Functions§

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

Type Aliases§

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