首页 > 学院 > 开发设计 > 正文

URLProtocolClient

2019-11-09 13:54:12
字体:
来源:转载
供稿:网友

URLPRotocolClient主要用于对自定义的NSURLProtocol子类提供URL数据交互接口。

Symbols

1 Protocol Methods

// 重定向请求和返回数据public func urlProtocol(_ protocol: URLProtocol, wasRedirectedTo request: URLRequest, redirectResponse: URLResponse)// 校验缓存是有效的public func urlProtocol(_ protocol: URLProtocol, cachedResponseIsValid cachedResponse: CachedURLResponse)// 设置请求回调数据的缓存策略public func urlProtocol(_ protocol: URLProtocol, didReceive response: URLResponse, cacheStoragePolicy policy: URLCache.StoragePolicy)// 回调请求对应的数据public func urlProtocol(_ protocol: URLProtocol, didLoad data: Data)// 加载完毕public func urlProtocolDidFinishLoading(_ protocol: URLProtocol)// 加载出错public func urlProtocol(_ protocol: URLProtocol, didFailWithError error: Error)// 启动身份验证public func urlProtocol(_ protocol: URLProtocol, didReceive challenge: URLAuthenticationChallenge)// 取消证书验证public func urlProtocol(_ protocol: URLProtocol, didCancel challenge: URLAuthenticationChallenge)

 


Appendix

Sample Code

Swift

URLProtocolClient

Revision History

时间 描述
2017-02-10 博文完成

CSDN:http://blog.csdn.net/y550918116j

GitHub:https://github.com/937447974


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表