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.

Macros§

json_value
Construct a serde_json::Value from a JSON literal.

Structs§

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

Enums§

JsonValue
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§

hash_map_xx_hash3_64
Creates a new HashMapXxHash3_64 with the default hasher.
json_from_reader
Deserialize an instance of type T from an I/O stream of JSON.
json_from_slice
Deserialize an instance of type T from bytes of JSON text.
json_from_str
Deserialize an instance of type T from a string of JSON text.
json_from_value
Interpret a serde_json::Value as an instance of type T.
json_to_string
Serialize the given data structure as a String of JSON.
json_to_string_pretty
Serialize the given data structure as a pretty-printed String of JSON.
json_to_value
Convert a T into serde_json::Value which is an enum that can represent any valid JSON data.
json_to_vec
Serialize the given data structure as a JSON byte vector.
json_to_vec_pretty
Serialize the given data structure as a pretty-printed JSON byte vector.
json_to_writer
Serialize the given data structure as JSON into the I/O stream.
json_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
JsonResult
Alias for a Result with the error type serde_json::Error.
RequestResult
Result type for HTTP requests, containing either a response or error.
WebSocketMessageResult
WebSocketResult