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

Traits

Type Definitions