FWUrlFilterProtocol
@protocol FWUrlFilterProtocol <NSObject>
FWUrlFilterProtocol can be used to append common parameters to requests before sending them.
-
Preprocess request URL before actually sending them.
Declaration
Objective-C
- (nonnull NSString *)filterUrl:(nonnull NSString *)originUrl withRequest:(nonnull FWBaseRequest *)request;
Parameters
originUrl
request’s origin URL, which is returned by
requestUrl
request
request itself
Return Value
A new url which will be used as a new
requestUrl
-
Preprocess URLRequest before actually sending them.
Declaration
Objective-C
- (void)filterUrlRequest:(nonnull NSMutableURLRequest *)urlRequest withRequest:(nonnull FWBaseRequest *)request;
Parameters
urlRequest
request’s URLRequest
request
request itself
-
Postprocess request before actually run callback.
Declaration
Objective-C
- (BOOL)filterResponse:(nonnull FWBaseRequest *)request withError:(NSError *__autoreleasing _Nullable *_Nullable)error;
Parameters
request
request itself
error
result error