Skip to main content

Crate http_request

Crate http_request 

Source
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’.
ClientConfig
Common configuration for (typically) all connections made by a program.
ClientConnection
This represents a single TLS client connection.
Context
The context of an asynchronous task.
Duration
A Duration type to represent a span of time, typically used for system timeouts.
Formatter
Configuration for formatting.
FromUtf8Error
A possible error value when converting a String from a UTF-8 byte vector.
HashMap
A hash map implemented with quadratic probing and SIMD lookup.
HashSet
A hash set implemented as a HashMap where the value is ().
HttpRequest
HTTP request data and execution state.
HttpResponse
Parsed HTTP response.
HttpUrlComponents
Represents the components of a parsed HTTP URL.
IntoIter
An iterator that moves out of a vector.
InvalidDnsNameError
The provided input could not be parsed because it is not a syntactically-valid DNS Name.
Ipv4Addr
An IPv4 address.
Ipv6Addr
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.
ProxyTunnelStream
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.
RequestBuilder
Fluent builder for HttpRequest.
RootCertStore
A container for root certificates able to provide a root-of-trust for connection authentication.
StreamOwned
This type implements io::Read and io::Write, encapsulating and owning a Connection C and an underlying transport T, such as a socket.
SyncProxyTunnelStream
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 async connect method.
VecDeque
A double-ended queue implemented with a growable ring buffer.

Enums§

Compress
Represents different compression algorithms supported by the library.
ContentType
Supported HTTP content types.
HttpStatus
Standard HTTP status codes.
HttpVersion
Represents the HTTP version used in the request or response.
Method
Defines the Method enum, representing HTTP request methods.
Poll
Indicates whether a value is available or if the current task has been scheduled to receive a wakeup instead.
ProxyType
Proxy protocol family.
RequestError
ServerName
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§

AsyncRead
Reads bytes from a source.
AsyncReadExt
Reads bytes from a source.
AsyncWrite
Writes bytes asynchronously.
AsyncWriteExt
Writes bytes to a sink.
Display
Format trait for an empty format, {}.
Read
The Read trait 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_64 with the default hasher.
new_response_headers
Construct an empty response header map.

Type Aliases§

HashMapXxHash3_64
HttpResponseHeaders
HTTP response headers — single-value HashMap<String, String>.
RequestHeaders
Map of HTTP request headers (single value per key).
RequestHeadersKey
An alias for String, representing the key type for request headers.
RequestHeadersValue
An alias for VecDeque<RequestHeadersValueItem>, representing a collection of values for a single HTTP request header.
RequestResult
Result of an HTTP request send.
ResponseBody
Raw response body bytes (alias for Vec<u8> to match http-type).
ResponseData
Raw bytes of the full serialized HTTP response.
ResponseDataString
UTF-8 form of the full serialized HTTP response.
ResponseStatusCode
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"].