1. AFN经典报错
error------------------Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/html"
2. 原因是由于使用cocoaPod 导入AFN框架之后AFN.serialization.response不支持text/html类型
3. 解决方案
打开Xcode commond + 3在搜索框中输入
AFURLResponseSerialization.m
4. 进入框架AFURLResponseSerialization.m头文件
5. commond + L 输入228
6. 修改以下代码
self.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json",@"text/javascript", nil];
7. 添加 @"text/html"
self.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json",@"text/html", @"text/javascript", nil];
8.编译 重新运行