URLSessionBasedNetworkOperationUtilities
public struct URLSessionBasedNetworkOperationUtilities
Undocumented
-
Creates and returns a block that builds a
CallOperation
from aCall.Request
using aURLSession
.Declaration
Swift
public static func createCallOperationBuilder(with scheme: URLScheme, session: URLSession, delegate: URLSessionEventHub) -> (Call.Request) -> CallOperation
Parameters
scheme
A scheme to use when building the operation.
session
A session used to create data tasks.
delegate
The session delegate.
Return Value
A block that builds a
URLSessionDataTask
-backedCallOperation
from aCall.Request
. -
Creates and returns a block that builds an
UploadOperation
from anUpload.Request
using aURLSession
.Declaration
Swift
public static func createUploadOperationBuilder(with scheme: URLScheme, session: URLSession, delegate: URLSessionEventHub) -> (Upload.Request) -> UploadOperation
Parameters
scheme
A scheme to use when building the operation.
session
A session used to create upload tasks.
delegate
The session delegate.
Return Value
A block that builds a
URLSessionUploadTask
-backedUploadOperation
from anUpload.Request
. -
Creates and returns a block that builds a
DownloadOperation
from aDownload.Request
using aURLSession
.Declaration
Swift
public static func createDownloadOperationBuilder(with session: URLSession, delegate: URLSessionEventHub) -> (Download.Request) -> DownloadOperation
Parameters
session
A session used to create download tasks.
delegate
The session delegate.
Return Value
A block that builds a
URLSessionDownloadTask
-backedDownloadOperation
from aDownload.Request
.