IOS初级:AFNetworking
来源:互联网 发布:逛数码 淘宝达人 编辑:程序博客网 时间:2024/05/17 02:54
狗 日的,第三方框架真j8难搞
1.为什么NS_ASSUME_NONNULL_BEGIN在6.2报错,你他么的还挑IDE,你这是什么态度?
2.还有,你他么的自动给老子转json了,有问过我么?
#import "ViewController.h"#import "AFNetworking/AFNetworking.h"@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad]; NSString *strUrl=[NSString stringWithFormat:@"http://demo.com/app/index.php/app_ios_0_1/userInfo"]; AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; NSDictionary *dict = @{@"uid":@"1"}; manager.responseSerializer.acceptableContentTypes = [manager.responseSerializer.acceptableContentTypes setByAddingObject:@"text/plain"]; [manager GET:strUrl parameters:dict success:^(AFHTTPRequestOperation *operation, id responseObject){ NSLog(@"%@",operation.request.allHTTPHeaderFields); NSLog(@"%@",operation.response); NSLog(@"%@",responseObject); NSLog(@"get key uname = %@",[responseObject objectForKey:@"uname"]); }failure:^(AFHTTPRequestOperation *operation,NSError *error){ NSLog(@"%@",error); }]; [self networkStatus];}-(void)networkStatus{ [[AFNetworkReachabilityManager sharedManager] startMonitoring]; [[AFNetworkReachabilityManager sharedManager] setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status){ NSLog(@"status=%d",status); }];}
2015-10-01 00:26:49.287 afnet[906:20954] status=2
2015-10-01 00:26:49.418 afnet[906:20954] {
"Accept-Language" = "en;q=1, fr;q=0.9, de;q=0.8, zh-Hans;q=0.7, zh-Hant;q=0.6, ja;q=0.5";
"User-Agent" = "afnet/1 (iPhone Simulator; iOS 8.2; Scale/2.00)";
}
2015-10-01 00:26:49.419 afnet[906:20954] <NSHTTPURLResponse: 0x7a67bba0> { URL: http://demo.com/app/index.php/app_ios_0_1/userInfo?uid=1 } { status code: 200, headers {
Connection = "Keep-Alive";
"Content-Encoding" = gzip;
"Content-Length" = 112;
"Content-Type" = "text/plain; charset=UTF-8";
CpuTime = 28;
Date = "Wed, 30 Sep 2015 16:26:04 GMT";
"Keep-Alive" = "timeout=1, max=100";
Server = "Apache/2";
Vary = "Accept-Encoding,User-Agent";
"X-Powered-By" = "PHP/5.2.17";
} }
2015-10-01 00:26:49.420 afnet[906:20954] {
message = ok;
pwd = fea7f657f56a2a448da7d4b535ee5e279caf3d9a;
response = 200000;
uid = 1;
uname = liuyi;
}
2015-10-01 00:26:49.420 afnet[906:20954] get key uname = liuyi
2015-10-01 00:26:49.418 afnet[906:20954] {
"Accept-Language" = "en;q=1, fr;q=0.9, de;q=0.8, zh-Hans;q=0.7, zh-Hant;q=0.6, ja;q=0.5";
"User-Agent" = "afnet/1 (iPhone Simulator; iOS 8.2; Scale/2.00)";
}
2015-10-01 00:26:49.419 afnet[906:20954] <NSHTTPURLResponse: 0x7a67bba0> { URL: http://demo.com/app/index.php/app_ios_0_1/userInfo?uid=1 } { status code: 200, headers {
Connection = "Keep-Alive";
"Content-Encoding" = gzip;
"Content-Length" = 112;
"Content-Type" = "text/plain; charset=UTF-8";
CpuTime = 28;
Date = "Wed, 30 Sep 2015 16:26:04 GMT";
"Keep-Alive" = "timeout=1, max=100";
Server = "Apache/2";
Vary = "Accept-Encoding,User-Agent";
"X-Powered-By" = "PHP/5.2.17";
} }
2015-10-01 00:26:49.420 afnet[906:20954] {
message = ok;
pwd = fea7f657f56a2a448da7d4b535ee5e279caf3d9a;
response = 200000;
uid = 1;
uname = liuyi;
}
2015-10-01 00:26:49.420 afnet[906:20954] get key uname = liuyi
0 0
- IOS初级:AFNetworking
- IOS--AFNetWorking
- iOS AFNetworking
- iOS AFNetWorking
- IOS AFNetworking 例子
- [IOS] AFNetworking 使用教程
- iOS 使用AFNetworking-----cpf
- iOS AFNetworking的使用
- IOS AFNetworking基本学习
- iOS 使用AFNetworking
- iOS AFNetworking 的使用
- iOS 使用AFNetworking
- iOS 使用AFNetworking
- iOS AFNetworking 使用
- iOS 使用AFNetworking
- iOS开发使用AFNetworking
- iOS 使用AFNetworking
- ios afnetworking获取cookie
- java集合框架以及性能分析
- EmguCv3中使用决策树
- Pro Git 笔记(思维导图)
- 为什么在过滤器中不到Session对象
- js、html中的单引号、双引号及其转义使用
- IOS初级:AFNetworking
- Ember.js 入门指南——查询参数
- .less的使用
- [leetcode] 274 275 H-Index I && II
- Shader入门指南【1】
- C语言结构体struct
- Java集合类性能分析2
- 《数据结构与算法分析》随机化算法--跳跃表详解
- iOS之OC随笔-plist文件解析