ResponseSerializer

public protocol ResponseSerializer<SerializedObject> : DataResponseSerializerProtocol, DownloadResponseSerializerProtocol

A serializer that can handle both data and download responses.

  • dataPreprocessor Default implementation

    DataPreprocessor used to prepare incoming Data for serialization.

    Default Implementation

    Declaration

    Swift

    var dataPreprocessor: any DataPreprocessor { get }
  • emptyRequestMethods Default implementation

    HTTPMethods for which empty response bodies are considered appropriate.

    Default Implementation

    Declaration

    Swift

    var emptyRequestMethods: Set<HTTPMethod> { get }
  • emptyResponseCodes Default implementation

    HTTP response codes for which empty response bodies are considered appropriate.

    Default Implementation

    Declaration

    Swift

    var emptyResponseCodes: Set<Int> { get }
  • defaultDataPreprocessor Extension method

    Declaration

    Swift

    public static var defaultDataPreprocessor: any DataPreprocessor { get }
  • defaultEmptyRequestMethods Extension method

    Default HTTPMethods for which empty response bodies are always considered appropriate. [.head] by default.

    Declaration

    Swift

    public static var defaultEmptyRequestMethods: Set<HTTPMethod> { get }
  • defaultEmptyResponseCodes Extension method

    HTTP response codes for which empty response bodies are always considered appropriate. [204, 205] by default.

    Declaration

    Swift

    public static var defaultEmptyResponseCodes: Set<Int> { get }
  • Determines whether the request allows empty response bodies, if request exists.

    Declaration

    Swift

    public func requestAllowsEmptyResponseData(_ request: URLRequest?) -> Bool?

    Parameters

    request

    URLRequest to evaluate.

    Return Value

    Bool representing the outcome of the evaluation, or nil if request was nil.

  • Determines whether the response allows empty response bodies, if response exists.

    Declaration

    Swift

    public func responseAllowsEmptyResponseData(_ response: HTTPURLResponse?) -> Bool?

    Parameters

    response

    HTTPURLResponse to evaluate.

    Return Value

    Bool representing the outcome of the evaluation, or nil if response was nil.

  • Determines whether request and response allow empty response bodies.

    Declaration

    Swift

    public func emptyResponseAllowed(forRequest request: URLRequest?, response: HTTPURLResponse?) -> Bool

    Parameters

    request

    URLRequest to evaluate.

    response

    HTTPURLResponse to evaluate.

    Return Value

    true if request or response allow empty bodies, false otherwise.

Decodable

Available where Self == DataResponseSerializer

Available where Self == StringResponseSerializer