美文网首页
ios 关于AFNetworking请求报500

ios 关于AFNetworking请求报500

作者: 雪_晟 | 来源:发表于2017-08-29 16:15 被阅读268次

    Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: internal server error (500)" UserInfo={NSUnderlyingError=0x7f8608dea390 {Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/html" UserInfo={com.alamofire.serialization.response.error.response= { URL: http://120.76.142.118:8080/nursery/api/login/updateheadportrait } { status code: 500, headers

    请求.png

    NSString * invoiceId = responseObject[@"data"][@"invoiceId"];
    如果是上面这样处理.
    阐述一种情况,如上图,请求结果 invoiceid 通过返回的结果我们可以用NSString类型接收,显示也是没有问题,(MJExtension已经处理过)但是如果这个结果需要作为参数传给后台,后台限制类型是字符串,这个时候就会报错500,需要处理的是
    NSString * invoiceId = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"invoiceId"]];

    相关文章

      网友评论

          本文标题:ios 关于AFNetworking请求报500

          本文链接:https://www.haomeiwen.com/subject/dxaodxtx.html