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.
- Http
Response Binary - A struct representing an HTTP response.
- Http
Response Text - A struct representing an HTTP response.
- Map
- Represents a JSON key/value type.
- Number
- Represents a JSON number, whether integer or floating point.
- Request
Builder - Builder pattern for constructing
HttpRequestinstances. - Stream
Deserializer - Iterator that deserializes a stream into multiple JSON values.
- WebSocket
Builder - WebSocket
Error
Enums§
- 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§
- from_
reader - Deserialize an instance of type
Tfrom an I/O stream of JSON. - from_
slice - Deserialize an instance of type
Tfrom bytes of JSON text. - from_
str - Deserialize an instance of type
Tfrom a string of JSON text. - from_
value - Interpret a
serde_json::Valueas an instance of typeT. - hash_
map_ xx_ hash3_ 64 - Creates a new
HashMapXxHash3_64with 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
Tintoserde_json::Valuewhich 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§
- 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
ResponseTraittrait. - BoxWeb
Socket Trait - Boxed synchronous WebSocket trait object.
- Hash
MapXx Hash3_ 64 - Request
Result - Result type for HTTP requests, containing either a response or error.
- WebSocket
Message Result - WebSocket
Result