Crate http_request

Crate http_request 

Source
Expand description

http-request

http-request is a lightweight, efficient library for building, sending, and handling HTTP/HTTPS requests in Rust applications. It provides a simple and intuitive API, allowing developers to easily interact with web services, whether they use the “HTTP” or “HTTPS” protocol. The library supports various HTTP methods, custom headers, request bodies, timeout, automatic handling of redirects (including detecting redirect loops), and enhanced response body decoding (both automatic and manual), enabling fast and secure communication. Whether working with secure “HTTPS” connections or standard “HTTP” requests, the library is optimized for performance, minimal resource usage, and easy integration into Rust projects.

Modules§

value
The Value enum, a loosely typed way of representing any valid JSON value.

Structs§

Deserializer
A structure that deserializes JSON into Rust values.
Error
This type represents all possible errors that can occur when serializing or deserializing JSON data.
HttpResponseBinary
A struct representing an HTTP response.
HttpResponseText
A struct representing an HTTP response.
Map
Represents a JSON key/value type.
Number
Represents a JSON number, whether integer or floating point.
RequestBuilder
Builder pattern for constructing HttpRequest instances.
StreamDeserializer
Iterator that deserializes a stream into multiple JSON values.
WebSocketBuilder
WebSocketError

Enums§

Value
Represents any valid JSON value.
WebSocketErrorKind

Traits§

AsyncRequestTrait
Asynchronous HTTP request trait.
AsyncWebSocketTrait
Asynchronous WebSocket operations trait.
RequestTrait
Synchronous HTTP request trait.
ResponseTrait
A trait representing common behaviors for HTTP response types.
WebSocketTrait
Synchronous WebSocket operations trait.

Functions§

from_reader
Deserialize an instance of type T from an I/O stream of JSON.
from_slice
Deserialize an instance of type T from bytes of JSON text.
from_str
Deserialize an instance of type T from a string of JSON text.
from_value
Interpret a serde_json::Value as an instance of type T.
hash_map_xx_hash3_64
Creates a new HashMapXxHash3_64 with the default hasher.
to_string
Serialize the given data structure as a String of JSON.
to_string_pretty
Serialize the given data structure as a pretty-printed String of JSON.
to_value
Convert a T into serde_json::Value which is an enum that can represent any valid JSON data.
to_vec
Serialize the given data structure as a JSON byte vector.
to_vec_pretty
Serialize the given data structure as a pretty-printed JSON byte vector.
to_writer
Serialize the given data structure as JSON into the I/O stream.
to_writer_pretty
Serialize the given data structure as pretty-printed JSON into the I/O stream.

Type Aliases§

BoxAsyncRequestTrait
Boxed trait object for asynchronous HTTP requests.
BoxAsyncWebSocketTrait
Boxed asynchronous WebSocket trait object.
BoxRequestTrait
Boxed trait object for synchronous HTTP requests.
BoxResponseTrait
A type alias for a boxed dynamic trait object implementing the ResponseTrait trait.
BoxWebSocketTrait
Boxed synchronous WebSocket trait object.
HashMapXxHash3_64
RequestResult
Result type for HTTP requests, containing either a response or error.
WebSocketMessageResult
WebSocketResult