Alamofire分析
来源:互联网 发布:木马网络行为分析 编辑:程序博客网 时间:2024/05/20 14:16
Manager 生成Request
Request根据请求不同生成不同的delegate对象
SessionDelegate 利用subdelegates存储对应Request的对应的deleagte
同时实现一些通用的SessionDelegate
通过self[task] 调用对应的delegate方法
之所以这么实现大概是为了是Request能处理文件上传,下载,同时请求数据。
Request根据请求不同生成不同的delegate对象
SessionDelegate 利用subdelegates存储对应Request的对应的deleagte
同时实现一些通用的SessionDelegate
通过self[task] 调用对应的delegate方法
之所以这么实现大概是为了是Request能处理文件上传,下载,同时请求数据。
参考 http://www.cocoachina.com/ios/20151118/14240.html
另外信任无效证书代码如下
func acceptInvalidSSLCerts() { let manager = Alamofire.Manager.sharedInstance print("trying to accept invalid certs") manager.delegate.sessionDidReceiveChallenge = { session, challenge in var disposition: NSURLSessionAuthChallengeDisposition = .PerformDefaultHandling var credential: NSURLCredential? print("received challenge") if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust { disposition = NSURLSessionAuthChallengeDisposition.UseCredential credential = NSURLCredential(forTrust: challenge.protectionSpace.serverTrust!) } else { if challenge.previousFailureCount > 0 { disposition = .CancelAuthenticationChallenge } else { credential = manager.session.configuration.URLCredentialStorage?.defaultCredentialForProtectionSpace(challenge.protectionSpace) if credential != nil { disposition = .UseCredential } } } return (disposition, credential) }}
0 0
- Alamofire分析
- Alamofire源码分析
- Alamofire
- 从Alamofire中得到返回值 分析
- Alamofire封装
- Alamofire安装使用方法
- Alamofire 使用教程
- swift开发之Alamofire
- Alamofire怎么请求WebService
- Swift网络库Alamofire
- <iOS>Alamofire的使用
- IOS alamofire网络请求
- Alamofire功能介绍
- Alamofire post json
- Alamofire post header json
- Alamofire 入门教程(下)
- 使用Cocoapods安装Alamofire
- No such module alamofire
- poj之旅——2236,1703
- 构件图和部署图--trufun UML2推荐
- Dialog对话框
- Android6.0 Telephony流程分析——PhoneApp启动主要类关系分析
- C++第14周项目模板【项目2-两个成员的类模板】 !!!!!!!
- Alamofire分析
- const详解
- u盘启动安装Ubuntu,安装报错vesamenu.c32:not a COM32R image解决
- Windows 7硬盘安装Ubuntu系统
- arm-none-linux-gnueabi交叉工具链 no such file or directory
- C primer plus 第八章 例题练习(递归)
- Eclipse常见问题及解决
- 计算机视觉&图像处理领域重要期刊汇总
- poj 1125