今天体验AFNetwork 3.1.0 进行数据解析,但是解析数据控制台一直都输出这样的 error 结果: 于是,照着以前AFN2.+版本的进行设置: 结果发现在新版本的 AFN 上不能设置了.既然代码改不了,那就去寻找根源吧,到AFURLResponseSerializer.m文件中,将 text/html加上去即可,如图: OK!搞定啦.…
在Jmeter运行http请求时报错: {"timestamp":"2019-11-12T02:39:28.949+0000","status":415,"error":"Unsupported Media Type","message":"Content type 'text/plain;charset=UTF-8' not supported","pat…
postman报Unsupported Media Type: Content type 'text/plain;charset=UTF-8' not supported postman之所以报Unsupported Media Type: Content type 'text/plain;charset=UTF-8' not supported错误,是发送数据的格式不正确,需要修改数据的发送方式所匹配的格式. 因为发送的数据是json格式的,而postman默认是text格式,有些会报错,所以…
使用AFNetworking出现报错: error=Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/html" UserInfo=0x7fdfd8729680 {com.alamofire.serialization.response.error.response= { URL: http://172.1…
接口访问出错了,用浏览器测试,发现可以正常返回数据. 下面是错误信息: 获取服务器响应出错 error=Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/html" UserInfo=0x7fdfd8729680 {com.alamofire.serialization.response.error.res…
错误日志: Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/html" UserInfo={com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x7f999be478d0> { URL: myUrlX…
错误日志是: Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/html" UserInfo={com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x7fc8b970eb70> { URL: http:…
iOS 使用AFNetworking遇到错误 Request failed: unacceptable content-type: text/html 原因: 不可接受的内容类型 “text/html” 解决方案: AFJSONResponseSerializer.m中,222行左右 把 这句: self.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json",…
使用AFNetworking 2.0 请求数据时出现错误 Request failed: unacceptable content-type: text/html 解决方法 添加一行 manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/html"]; 即可 整个代码为: AFHTTPRequestOperationManager *manager = [AFHTTPRequest…
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…