SDWebImageDownloaderResponseModifier

A downloader response modifier class with block.

Conveniences

  • Create the response modifier with HTTP Status code.

    Note

    This is for convenience, if you need code to control the logic, use block API instead.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithStatusCode:(NSInteger)statusCode;

    Swift

    init(statusCode: Int)

    Parameters

    statusCode

    HTTP Status Code.

  • Create the response modifier with HTTP Version. Status code defaults to 200.

    Note

    This is for convenience, if you need code to control the logic, use block API instead.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithVersion:(nullable NSString *)version;

    Swift

    init(version: String?)

    Parameters

    version

    HTTP Version, nil means “HTTP/1.1”.

  • Create the response modifier with HTTP Headers. Status code defaults to 200.

    Note

    This is for convenience, if you need code to control the logic, use block API instead.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithHeaders:
        (nullable NSDictionary<NSString *, NSString *> *)headers;

    Swift

    init(headers: [String : String]?)

    Parameters

    headers

    HTTP Headers. Case insensitive according to HTTP/1.1(HTTP/2) standard. The headers will override the same fields from original response.

  • Create the response modifier with HTTP Status Code, Version and Headers.

    Note

    This is for convenience, if you need code to control the logic, use block API instead.

    Declaration

    Objective-C

    - (nonnull instancetype)
        initWithStatusCode:(NSInteger)statusCode
                   version:(nullable NSString *)version
                   headers:(nullable NSDictionary<NSString *, NSString *> *)headers;

    Swift

    init(statusCode: Int, version: String?, headers: [String : String]?)

    Parameters

    statusCode

    HTTP Status Code.

    version

    HTTP Version, nil means “HTTP/1.1”.

    headers

    HTTP Headers. Case insensitive according to HTTP/1.1(HTTP/2) standard. The headers will override the same fields from original response.