2015-11-16 10:39:17.235 PullDemo[338:60b] Application windows are expected to have a root view controller at the end of application launch 2015-11-16 10:39:17.500 PullDemo[338:60b] Error Domain=com.alamofire.error.serialization.response Code=-1016 "R…
在发送请求后一直报错, 浏览器解析却没有问题, 所以基本可以确定是AFNetworking的问题 下面是解决方法: AFHTTPSessionManager *manager = [AFHTTPSessionManager manager]; // 添加这句代码 manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json&q…
AFHTTPSessionManager * manager = [AFHTTPSessionManager manager]; manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json",@"text/javascript",@"text/html",nil];…
在使用AFNetworking 2.0  的时候本来一切很顺畅,但是中途遇到几个比较坑的地方 这里分享一下爬坑经历,忘读者不能速爬坑! 在发送请求后,NSURLSessionDataTask一直报错 Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/html" AFURLResponseSerializat…
使用AFNetworking 2.0 请求数据时出现错误 Request failed: unacceptable content-type: text/html 解决方法 添加一行 manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/html"]; 即可 整个代码为: AFHTTPRequestOperationManager *manager = [AFHTTPRequest…
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/html"]; 1:优先让服务器做好返回类型适配 2:服务器不做的话, 在程序中再加上上面的代码. 把类型加上.…
使用AFNetworking3.0后网络请求由原来的AFHTTPRequestOperationManager变为AFHTTPSessionManager.一般的Post请求变成了这样: NSMutableDictionary *params = [NSMutableDictionary dictionary];    params[@"phoneNumber"] = @"18000000000";    params[@"password"]…
注意到咱们集成的版本为3.0.4. 下面的类已从AFNetworking 3.0中废弃: AFURLConnectionOperation AFHTTPRequestOperation AFHTTPRequestOperationManager 以及很多修改,有兴趣的可以了解一下. 下面开始实践一下: // 请求的参数 NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:@"20131129", @"d…
Error Domain=kCLErrorDomain Code=0 "The operation couldn’t be completed. (kCLErrorDomain error 0.)" 输出了这个erro 其实是模拟器故障,把模拟器退出了,然后重新run一下就好了…