Expand description
HTTP client.
This module is a thin wrapper around the isahc
crate that just limits the API surface to only
async
methods without the async suffix. You can convert from/into that isahc
types and this one.
§Examples
Get some text:
let text = task::http::get_txt("https://httpbin.org/base64/SGVsbG8gV29ybGQ=").await?;
println!("{text}!");
Modules§
- HTTP header types
- URI component of request and response lines
Structs§
- HTTP request body.
- Represents a SHA-512/256 hash computed from a normalized request.
- Represents a serializable configuration for a cache entry in a
CacheDb
. - HTTP client.
- Builder that can be used to create a
Client
. - Information stored about an HTTP cookie.
- Provides automatic cookie session management using an in-memory cookie store.
- Error returned by
set_default_client_init
if the default was already initialized. - A simple
CacheDb
implementation that uses a local directory. - The Request Method (VERB)
- Information about the state of an HTTP request.
- HTTP request.
- A
Request
builder. - HTTP response.
- An HTTP status code (
status-code
in RFC 7230 et al.). - The URI component of a request.
Enums§
- Cache mode selected for a
Uri
. - An error encountered while sending an HTTP request or receiving an HTTP response using a
Client
. - Describes a policy for handling server redirects.
Statics§
- Metrics in a
Progress::with_meta
metadata.
Traits§
- Represents a download cache in a
Client
. - Marker trait for types that try-to-convert to
Body
. - Marker trait for types that try-to-convert to
header::HeaderName
. - Marker trait for types that try-to-convert to
header::HeaderValue
. - Marker trait for types that try-to-convert to
Method
. - Marker trait for types that try-to-convert to
Uri
.
Functions§
- The
Client
used by the functions in this module. - Send a DELETE request to the
uri
. - Send a GET request to the
uri
. - Send a GET request to the
uri
and read the response as raw bytes. - Send a GET request to the
uri
and de-serializes the response. - Send a GET request to the
uri
and read the response as a string. - Send a HEAD request to the
uri
. - Send a POST request to the
uri
with a given request body. - Send a PUT request to the
uri
with a given request body. - Send a custom
Request
. - Set a custom initialization function for the
default_client
.
Type Aliases§
- Head parts from a split
Response
.