ResponseSerializer
public protocol ResponseSerializer : DataResponseSerializerProtocol, DownloadResponseSerializerProtocol
A serializer that can handle both data and download responses.
-
dataPreprocessor
Default implementationDataPreprocessor
used to prepare incomingData
for serialization.Default Implementation
Declaration
Swift
var dataPreprocessor: DataPreprocessor { get }
-
emptyRequestMethods
Default implementationHTTPMethod
s for which empty response bodies are considered appropriate.Default Implementation
Declaration
Swift
var emptyRequestMethods: Set<HTTPMethod> { get }
-
emptyResponseCodes
Default implementationHTTP response codes for which empty response bodies are considered appropriate.
Default Implementation
Declaration
Swift
var emptyResponseCodes: Set<Int> { get }
-
defaultDataPreprocessor
Extension methodDefault
DataPreprocessor
.PassthroughPreprocessor
by default.Declaration
Swift
public static var defaultDataPreprocessor: DataPreprocessor { get }
-
defaultEmptyRequestMethods
Extension methodDefault
HTTPMethod
s for which empty response bodies are considered appropriate.[.head]
by default.Declaration
Swift
public static var defaultEmptyRequestMethods: Set<HTTPMethod> { get }
-
defaultEmptyResponseCodes
Extension methodHTTP response codes for which empty response bodies are considered appropriate.
[204, 205]
by default.Declaration
Swift
public static var defaultEmptyResponseCodes: Set<Int> { get }
-
requestAllowsEmptyResponseData(_:
Extension method) Determines whether the
request
allows empty response bodies, ifrequest
exists.Declaration
Swift
public func requestAllowsEmptyResponseData(_ request: URLRequest?) -> Bool?
Parameters
request
URLRequest
to evaluate.Return Value
Bool
representing the outcome of the evaluation, ornil
ifrequest
wasnil
. -
responseAllowsEmptyResponseData(_:
Extension method) Determines whether the
response
allows empty response bodies, ifresponse
exists`.Declaration
Swift
public func responseAllowsEmptyResponseData(_ response: HTTPURLResponse?) -> Bool?
Parameters
response
HTTPURLResponse
to evaluate.Return Value
Bool
representing the outcome of the evaluation, ornil
ifresponse
wasnil
. -
emptyResponseAllowed(forRequest:
Extension methodresponse: ) Determines whether
request
andresponse
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
ifrequest
orresponse
allow empty bodies,false
otherwise.