ResponseSerializer
public protocol ResponseSerializer : DataResponseSerializerProtocol, DownloadResponseSerializerProtocol
A serializer that can handle both data and download responses.
-
dataPreprocessorDefault implementationDataPreprocessorused to prepare incomingDatafor serialization.Default Implementation
Declaration
Swift
var dataPreprocessor: DataPreprocessor { get } -
emptyRequestMethodsDefault implementationHTTPMethods for which empty response bodies are considered appropriate.Default Implementation
Declaration
Swift
var emptyRequestMethods: Set<HTTPMethod> { get } -
emptyResponseCodesDefault implementationHTTP response codes for which empty response bodies are considered appropriate.
Default Implementation
Declaration
Swift
var emptyResponseCodes: Set<Int> { get }
-
defaultDataPreprocessorExtension methodDefault
DataPreprocessor.PassthroughPreprocessorby default.Declaration
Swift
public static var defaultDataPreprocessor: DataPreprocessor { get } -
defaultEmptyRequestMethodsExtension methodDefault
HTTPMethods for which empty response bodies are considered appropriate.[.head]by default.Declaration
Swift
public static var defaultEmptyRequestMethods: Set<HTTPMethod> { get } -
defaultEmptyResponseCodesExtension 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
requestallows empty response bodies, ifrequestexists.Declaration
Swift
public func requestAllowsEmptyResponseData(_ request: URLRequest?) -> Bool?Parameters
requestURLRequestto evaluate.Return Value
Boolrepresenting the outcome of the evaluation, ornilifrequestwasnil. -
responseAllowsEmptyResponseData(_:Extension method) Determines whether the
responseallows empty response bodies, ifresponseexists`.Declaration
Swift
public func responseAllowsEmptyResponseData(_ response: HTTPURLResponse?) -> Bool?Parameters
responseHTTPURLResponseto evaluate.Return Value
Boolrepresenting the outcome of the evaluation, ornilifresponsewasnil. -
emptyResponseAllowed(forRequest:Extension methodresponse: ) Determines whether
requestandresponseallow empty response bodies.Declaration
Swift
public func emptyResponseAllowed(forRequest request: URLRequest?, response: HTTPURLResponse?) -> BoolParameters
requestURLRequestto evaluate.responseHTTPURLResponseto evaluate.Return Value
trueifrequestorresponseallow empty bodies,falseotherwise.
View on GitHub
Install in Dash
ResponseSerializer Protocol Reference