Expand description
http-request
An HTTP request library providing client-side HTTP request construction and response parsing.
Modules§
- self
- Utilities for formatting and printing
Strings.
Structs§
- Arc
- A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically Reference Counted’.
- Client
Config - Common configuration for (typically) all connections made by a program.
- Client
Connection - This represents a single TLS client connection.
- Context
- The context of an asynchronous task.
- Duration
- A
Durationtype to represent a span of time, typically used for system timeouts. - Formatter
- Configuration for formatting.
- From
Utf8 Error - A possible error value when converting a
Stringfrom a UTF-8 byte vector. - HashMap
- A hash map implemented with quadratic probing and SIMD lookup.
- HashSet
- A hash set implemented as a
HashMapwhere the value is(). - Http
Request - HTTP request data and execution state.
- Http
Response - Parsed HTTP response.
- Http
UrlComponents - Represents the components of a parsed HTTP URL.
- Into
Iter - An iterator that moves out of a vector.
- Invalid
DnsName Error - The provided input could not be parsed because it is not a syntactically-valid DNS Name.
- Ipv4
Addr - An IPv4 address.
- Ipv6
Addr - An IPv6 address.
- Pin
- A pointer which pins its pointee in place.
- Protocol
- A marker type representing HTTP protocol variants.
- Proxy
- Proxy configuration for an outgoing HTTP / WebSocket request.
- Proxy
Tunnel Stream - Async tunnel stream wrapping another async stream, with a buffer of pre-read bytes that are returned before delegating to the inner stream.
- ReadBuf
- A wrapper around a byte buffer that is incrementally filled and initialized.
- Request
Builder - Fluent builder for
HttpRequest. - Root
Cert Store - A container for root certificates able to provide a root-of-trust for connection authentication.
- Stream
Owned - This type implements
io::Readandio::Write, encapsulating and owning a ConnectionCand an underlying transportT, such as a socket. - Sync
Proxy Tunnel Stream - Sync tunnel stream wrapping another sync stream, with a buffer of pre-read bytes that are returned before delegating to the inner stream.
- TcpStream
- A TCP stream between a local and a remote socket.
- TlsConnector
- A wrapper around a
rustls::ClientConfig, providing an asyncconnectmethod. - VecDeque
- A double-ended queue implemented with a growable ring buffer.
Enums§
- Compress
- Represents different compression algorithms supported by the library.
- Content
Type - Supported HTTP content types.
- Http
Status - Standard HTTP status codes.
- Http
Version - Represents the HTTP version used in the request or response.
- Method
- Defines the
Methodenum, representing HTTP request methods. - Poll
- Indicates whether a value is available or if the current task has been scheduled to receive a wakeup instead.
- Proxy
Type - Proxy protocol family.
- Request
Error - Server
Name - Encodes ways a client can know the expected name of the server.
Constants§
- ACCEPT
- The HTTP header field name
accept. - ACCEPT_
ANY - Accept any content type.
- BR_
BYTES - A const byte slice representation of the string
BR. - COLON_
U8 - The byte representation of a colon character. This constant provides the byte equivalent of the colon character for use in low-level operations.
- CONTENT_
LENGTH - The HTTP header field name
content-length. - CONTENT_
TYPE - The HTTP header field name content-type, used to specify the media type of the resource or the data being sent in an http request or response.
- HOST
- The HTTP header field name
host, used to specify the host and port number of the server. - HTTPS_
LOWERCASE - Represents the lowercase “https” protocol string.
- HTTP_
BR_ BYTES - The byte representation of an HTTP line break. This constant provides the byte equivalent of the HTTP line break for use in low-level network operations.
- LOCATION
- The HTTP header field name
location, used to specify the url to redirect a client. - QUERY
- A query symbol (
?). This constant represents the question mark character, which is commonly used to denote the beginning of a query string in a URL. - SPACE_
U8 - The byte representation of a single space character. This constant provides the byte equivalent of the space character for use in low-level operations.
- TAB_U8
- The byte representation of a tab character. This constant provides the byte equivalent of the tab character for use in low-level operations.
- TLS_
SERVER_ ROOTS - USER_
AGENT - The HTTP header field
user-agent.
Traits§
- Async
Read - Reads bytes from a source.
- Async
Read Ext - Reads bytes from a source.
- Async
Write - Writes bytes asynchronously.
- Async
Write Ext - Writes bytes to a sink.
- Display
- Format trait for an empty format,
{}. - Read
- The
Readtrait allows for reading bytes from a source. - Serialize
- A data structure that can be serialized into any data format supported by Serde.
- Write
- A trait for objects which are byte-oriented sinks.
Functions§
- from_
utf8 - Converts a slice of bytes to a string slice.
- hash_
map_ xx_ hash3_ 64 - Creates a new
HashMapXxHash3_64with the default hasher. - new_
response_ headers - Construct an empty response header map.
Type Aliases§
- Hash
MapXx Hash3_ 64 - Http
Response Headers - HTTP response headers — single-value
HashMap<String, String>. - Request
Headers - Map of HTTP request headers (single value per key).
- Request
Headers Key - An alias for
String, representing the key type for request headers. - Request
Headers Value - An alias for
VecDeque<RequestHeadersValueItem>, representing a collection of values for a single HTTP request header. - Request
Result - Result of an HTTP request send.
- Response
Body - Raw response body bytes (alias for
Vec<u8>to matchhttp-type). - Response
Data - Raw bytes of the full serialized HTTP response.
- Response
Data String - UTF-8 form of the full serialized HTTP response.
- Response
Status Code - An alias for
usize, representing the numeric status code of the HTTP response.
Derive Macros§
- Serialize
- Derive macro available if serde is built with
features = ["derive"].