使用AFNetworking库 post方式请求php接口时,报下面的错误javascript
NSLocalizedDescription=Request failed: unacceptable content-type: text/htmlphp
网上找到了解决办法,在这里记录一下html
修改AFNetworking/AFURLResponseSerialization.m文件java
- (instancetype)init { self = [super init]; if (!self) { return nil; } self.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript", nil]; return self; }
在acceptableContentTypes 中增长 @"text/html"json