Back to Alamofire

DownloadResponseSerializerProtocol

docs/docsets/Alamofire.docset/Contents/Resources/Documents/Protocols/DownloadResponseSerializerProtocol.html

5.12.02.1 KB
Original Source

DownloadResponseSerializerProtocol

public protocol DownloadResponseSerializerProtocol<SerializedObject> : Sendable

The type to which all download response serializers must conform in order to serialize a response.

`

                SerializedObject
                `

The type of serialized object to be created.

Declaration

Swift

associatedtype SerializedObject : Sendable

`

                serializeDownload(request:response:fileURL:error:)
                `

Serialize the downloaded response Data from disk into the provided type.

Throws

Any Error produced during serialization.

Declaration

Swift

func serializeDownload(request: URLRequest?, response: HTTPURLResponse?, fileURL: URL?, error: (any Error)?) throws -> SerializedObject

Parameters

| request |

URLRequest which was used to perform the request, if any.

| | response |

HTTPURLResponse received from the server, if any.

| | fileURL |

File URL to which the response data was downloaded.

| | error |

Error produced by Alamofire or the underlying URLSession during the request.

|

Return Value

The SerializedObject.

Available where Self: DataResponseSerializerProtocol

`

                serializeDownload(request:response:fileURL:error:)
                ` Default implementation 

Default Implementation

Undocumented

Declaration

Swift

public func serializeDownload(request: URLRequest?, response: HTTPURLResponse?, fileURL: URL?, error: (any Error)?) throws -> Self.SerializedObject

Available where Self == URLResponseSerializer

`

                url
                ` Extension method 

Provides a URLResponseSerializer instance.

Declaration

Swift

public static var url: URLResponseSerializer { get }