APIClient
public protocol APIClient
网络请求客户端协议
-
创建数据请求
Declaration
Swift
func createDataRequest( request: URLRequest, queue: DispatchQueue, progressHandler: APIProgressHandler?, completionHandler: @escaping APIDataResponseCompletionHandler ) -> APIRequestTask
Parameters
request
请求
progressHandler
进度回调
completionHandler
结果回调
Return Value
请求任务
-
创建下载请求
Declaration
Swift
func createDownloadRequest( request: URLRequest, to: @escaping APIDownloadDestination, queue: DispatchQueue, progressHandler: APIProgressHandler?, completionHandler: @escaping APIDownloadResponseCompletionHandler ) -> APIRequestTask
Parameters
request
请求
to
设置下载的地址以及配置
progressHandler
进度回调
completionHandler
结果回调
Return Value
请求任务