Module pretend::interceptor
source · Expand description
Request interceptors
pretend
support request interceptors. They are used
to post-process an automatically generated request before
it is being executed.
Interceptors can facilitate setting common headers, like an user-agent, or injecting an authentication token.
By default a NoopRequestInterceptor
is used, and will
not modify the request.
Custom interceptors are defined by implementing InterceptRequest
.
Error handling
Request interceptors are allowed to fail. They return a pretend
Result
that will be returned as is to the caller. Prefer using
Error::Request
when reporting an error.
Structs
- A set of HTTP headers
- The Request Method (VERB)
- Default request interceptor
- An HTTP request
- A parsed URL record.
Traits
- Describe a request interceptor
Type Definitions
- Pretend Result type