URLProtocolClient

来源:互联网 发布:怎么修改远程桌面端口 编辑:程序博客网 时间:2024/06/05 21:38

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

0 0
原创粉丝点击