SDWebImageDownloaderRequestModifier

@protocol SDWebImageDownloaderRequestModifier <NSObject>

This is the protocol for downloader request modifier. We can use a block to specify the downloader request modifier. But Using protocol can make this extensible, and allow Swift user to use it easily instead of using @convention(block) to store a block into context options.

  • Modify the original URL request and return a new one instead. You can modify the HTTP header, cachePolicy, etc for this URL.

    Note

    If return nil, the URL request will be cancelled.

    Declaration

    Objective-C

    - (nullable NSURLRequest *)modifiedRequestWithRequest:
        (nonnull NSURLRequest *)request;

    Swift

    func modifiedRequest(with request: URLRequest) -> URLRequest?

    Parameters

    request

    The original URL request for image loading