-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Adding interceptors to Netable will be necessary for working with our mocking libraries.
I think we can be pretty flexible here and offload most of the work to the actual interceptors, but we need to provide something at the base level to allow interceptors to interface with Netable.
I think a good starting place might be:
-
Introduce new top level types called
InterceptorandRequestInterceptorthat look something likestruct Interceptor { let interceptors: [RequestInterceptor] }protocol RequestInterceptor { func adapt(_ request: URLRequest, instance: Netable) async throws -> URLRequest {} } -
Add optional parameters to both
Netable.initandNetable.requestthat accept anInterceptor -
Modify
requestto apply any interceptors to ourURLRequestbefore it gets sent off
Metadata
Metadata
Assignees
Labels
No labels