网络请求封装AFAppDotNetAPIClient中的代码
来源:互联网 发布:网络跳线架 编辑:程序博客网 时间:2024/06/01 09:06
封装以后就利用这个类进行网络数据的请求,首先申明一点,这个类是继承自AFHTTPSessionManager的。
+ (instancetype)sharedClient {
staticAFAppDotNetAPIClient *_sharedClient =nil;
staticdispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
_sharedClient = [[AFAppDotNetAPIClientalloc]initWithBaseURL:[NSURLURLWithString:SERVER_URL]];
_sharedClient.securityPolicy = [AFSecurityPolicypolicyWithPinningMode:AFSSLPinningModeNone];
// _sharedClient.responseSerializer =[AFXMLParserResponseSerializer serializer];
// _sharedClient.responseSerializer = [AFHTTPResponseSerializer serializer];
_sharedClient.responseSerializer = [AFJSONResponseSerializerserializer];
_sharedClient.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json",@"text/json",@"text/javascript",@"text/html",@"text/xml",@"text/plain",nil];
});
return _sharedClient;
}
- 网络请求封装AFAppDotNetAPIClient中的代码
- Android网络请求代码封装
- afnetworking网络请求,ios中的网络请求示例代码
- retrofit请求网络数据 将代码封装到工具包中
- 前端网络请求封装参考,不错,代码干货
- 封装网络请求
- 封装Ger网络请求
- 网络请求封装
- 封装网络请求(AFNetworking)
- 网络请求封装
- iOS封装网络请求
- Class_封装网络请求
- 封装网络请求
- 网络请求的封装
- 网络请求封装2
- 封装的网络请求
- 封装网络请求
- 网络请求的封装
- Android Studio中如何引用so文件
- 判断 iframe 是否加载完成的完美方法
- 将博客搬至CSDN
- GIT常用命令
- unity源码解析Transform
- 网络请求封装AFAppDotNetAPIClient中的代码
- Requests库使用
- MySQL 5.7 新特性详解
- 文章标题
- Mybatis实战教程之入门到精通(经典)
- Dubbo超时重试机制带来的数据重复问题
- 详解java序列化(一)
- BUG 收集
- List<T>的使用