1. AFN經典報錯javascript
error------------------Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/html"html
2. 緣由是因爲使用cocoaPod 導入AFN框架以後AFN.serialization.response不支持text/html類型java
3. 解決方案json
打開Xcode commond + 3在搜索框中輸入app
AFURLResponseSerialization.m框架
4. 進入框架AFURLResponseSerialization.m頭文件spa
5. commond + L 輸入228code
6. 修改如下代碼orm
self.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json",@"text/javascript", nil];htm
7. 添加 @"text/html"
self.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json",@"text/html", @"text/javascript", nil];
8.編譯 從新運行