Expand description
Lifecycle hooks for requests and responses.
Hooks::on_request and Hooks::on_response return Result. To abort the client
pipeline intentionally, return Err(Error::hook("reason")). Other Error variants
(Transport, Http, …) are valid when a hook needs to surface a specific failure.
Hooks::on_success, Hooks::on_error, and Hooks::on_retry cannot return errors.
Structs§
- Error
Context - Context when an error occurs.
- Hooks
- Lifecycle hooks for the HTTP client.
- Request
Context - Context for an outgoing request.
- Response
Context - Context after a response is received.
- Success
Context - Context after a successful HTTP response (2xx).