Expand description
§reqores
Oversimplified http request/response abstraction layer for bot_any
packages.
- Simple, lightweight abstraction
- Easily exchangeable client/server implementation
§Implementations
- reqores-client-surf - surf based, async client implementation
- reqores-universal-cf-worker - universal client/server implementation for Cloudflare Workers
§Example
Define a new ClientRequest
for your web API.
#[derive(Debug, Serialize, Deserialize)]
pub struct YourApiResponse { /* ... some fields ... */ }
pub struct YourApiCall;
impl ClientRequest for YourApiCall {
type Response = YourApiResponse;
fn url(&self) -> String {
"https://example.com/api".to_string()
}
fn method(&self) -> HttpMethod {
HttpMethod::Get
}
}
Modules§
- headers
- Collections for common headers
Structs§
- Http
Status Code Parse Error - The error type for parsing http status code
- Server
Response - The response made from the server.
- Server
Response Builder - The utility builder for
ServerResponse
.
Enums§
- Http
Method - The enum representing http request method
- Http
Status Code - The enum representing http status code
Traits§
- Client
Request - A client request to send
- Client
Response - The response made from
ClientRequest
. - Server
Request - The request accepted by the server.