AFNetWorking发送post请求,后台接收格式不正确

Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: internal server error (500)" UserInfo={NSLocalizedDescription=Request failed: internal server error (500), NSErrorFailingURLKey=http://49.4.3.233:8081/signin, com.alamofire.serialization.response.error.data=<7b22636f 6465223a 22657272 6f722e69 6e746572 6e616c73 65727665 72222c22 6d657373 61676522 3a224261 64206372 6564656e 7469616c 73227d>, com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x60000003aca0> { URL: http://49.4.3.233:8081/signin } { Status Code: 500, Headers {

    "Cache-Control" =     (

        "no-cache, no-store, max-age=0, must-revalidate"

    );

    Connection =     (

        close

    );

    "Content-Type" =     (

        "application/json;charset=UTF-8"

    );

    Date =     (

        "Wed, 15 Aug 2018 09:57:07 GMT"

    );

    Expires =     (

        0

    );

    Pragma =     (

        "no-cache"

    );

    "Transfer-Encoding" =     (

        Identity

    );

    "X-Content-Type-Options" =     (

        nosniff

    );

    "X-Frame-Options" =     (

        DENY

    );

    "X-XSS-Protection" =     (

        "1; mode=block"

    );

} }}报这种错误。

     各种验证后,发现是iOS正常发送的json格式,后台不认。最后更换成原生方式发送请求,设置

request.HTTPBody字符串,解决。

转载于:https://www.cnblogs.com/an74824/p/9487672.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值