Sian 发表于 2014-9-2 15:08:23

AFNetworking无法发送Web请求Code = -1016

2014-09-02 15:02:52.601 Crayfish Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/html"
从以上的错误提示来看问题已经明了了,unacceptable content-type: text/html"无法接受的内容类型“text/html”
解决办法:
找到AFURLResponseSerialization.m文件中的init方法
- (instancetype)init {
    self = ;
    if (!self) {
      return nil;
    }

    self.acceptableContentTypes = ;

    return self;
}
self.acceptableContentTypes = ;
在这行代码中增加text/html类型

self.acceptableContentTypes = @"text/html", nil];
OK,搞定!
页: [1]
查看完整版本: AFNetworking无法发送Web请求Code = -1016