Expand description
Lifecycle hooks for requests and responses.
Buffered responses use Hooks::on_response / Hooks::on_success. Streaming responses
(RequestBuilder::send_stream) use
Hooks::on_response_stream / Hooks::on_success_stream with status and headers only (no body).
Hooks::on_request and Hooks::on_response / Hooks::on_response_stream return Result.
To abort the client pipeline intentionally, return Err(Error::hook("reason")).
Hooks::on_success, Hooks::on_success_stream, 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 buffered response is received.
- Streaming
Response Context - Context after a streaming response is received (headers only; body not consumed).
- Streaming
Response Meta - Metadata returned from streaming response hooks.
- Streaming
Success Context - Context after a successful streaming response (2xx, metadata only).
- Success
Context - Context after a successful HTTP response (2xx).