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§
- Http
Response Binary - A struct representing an HTTP response.
- Http
Response Text - A struct representing an HTTP response.
- Json
Deserializer - A structure that deserializes JSON into Rust values.
- Json
Error - This type represents all possible errors that can occur when serializing or deserializing JSON data.
- JsonMap
- Represents a JSON key/value type.
- Json
Number - Represents a JSON number, whether integer or floating point.
- Json
Serializer - A structure for serializing Rust values into JSON.
- Json
Stream Deserializer - Iterator that deserializes a stream into multiple JSON values.
- Request
Builder - Builder pattern for constructing
HttpRequest
instances. - WebSocket
Builder - WebSocket
Error
Enums§
- Json
Value - Represents any valid JSON value.
- WebSocket
Error Kind
Traits§
- Async
Request Trait - Asynchronous HTTP request trait.
- Async
WebSocket Trait - Asynchronous WebSocket operations trait.
- Request
Trait - Synchronous HTTP request trait.
- Response
Trait - A trait representing common behaviors for HTTP response types.
- WebSocket
Trait - 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 typeT
. - 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
intoserde_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§
- BoxAsync
Request Trait - Boxed trait object for asynchronous HTTP requests.
- BoxAsync
WebSocket Trait - Boxed asynchronous WebSocket trait object.
- BoxRequest
Trait - Boxed trait object for synchronous HTTP requests.
- BoxResponse
Trait - A type alias for a boxed dynamic trait object implementing the
ResponseTrait
trait. - BoxWeb
Socket Trait - Boxed synchronous WebSocket trait object.
- Hash
MapXx Hash3_ 64 - Json
Result - Alias for a
Result
with the error typeserde_json::Error
. - Request
Result - Result type for HTTP requests, containing either a response or error.
- WebSocket
Message Result - WebSocket
Result