afn未能连接服务器,AFNetworking3.0 post发送body,服务器收不到body

用的AFN3.0,向内网服务器post发送body,报错

bVsGp9

Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: bad request (400)" UserInfo={com.alamofire.serialization.response.error.response= { URL: http://192.168.1.188:8080/mapi/index/index.json } { status code: 400, headers {

Connection = close;

"Content-Type" = "application/json;charset=UTF-8";

Date = "Fri, 05 Feb 2016 03:56:30 GMT";

Server = "Apache-Coyote/1.1";

"Transfer-Encoding" = Identity;

} }, NSErrorFailingURLKey=http://192.168.1.188:8080/mapi/index/index.json, NSLocalizedDescription=Request failed: bad request (400), com.alamofire.serialization.response.error.data=<7b226865 6164223a 7b22636f 6465223a 302c2262 6d657373 61676522 3a224661 696c7572 6521222c 226d6573 73616765 223a2220 343034e6 89bee4b8 8de588b0 20e28094 20e69c8d e58aa1e5 99a8e689 bee4b88d e588b0e7 bb99e5ae 9ae79a84 e8b584e6 ba90efbc 9be69687 e6a1a3e4 b88de5ad 98e59ca8 222c2262 636f6465 223a307d 2c226461 7461223a 7b22656d 70747922 3a6e756c 6c7d7d>}

已经设置infoplist的NSAppTransportSecurity

//直接调的这个方法进行post

[client POST:url

parameters:bodys

progress:nil

success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {

XLog(@"%@",responseObject);

} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {

XLog(@"%@",error);

}];

有没有人遇到过这种问题?,求解决方法

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值