搜索

首页  >  问答  >  正文

objective-c - IOS AFN POST请求 Code=-1011 internal server error (500)。

code如下:

AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];

NSDictionary *dic = @{@"model":@"b",@"token":@"bb",@"ShopName":@"bbb"};

[manager POST:@"http://masterhouse.cn/api/api.asmx?op=OnStartLook" parameters:parameters progress:^(NSProgress * _Nonnull uploadProgress) {
   
    
} success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
    NSLog(@"%@",responseObject);
    
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
    NSLog(@"%@",error);
}];

错误信息:
Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: internal server error (500)" UserInfo={NSUnderlyingError=0x7fd4725279a0 {Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: application/soap+xml" UserInfo={com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x7fd472526570> { URL: http://masterhouse.cn/api/api.asmx?op=OnStartLook } { status code: 500, headers {
"Cache-Control" = private;
"Content-Length" = 506;
"Content-Type" = "application/soap+xml; charset=utf-8";
Date = "Fri, 26 Aug 2016 08:30:47 GMT";
Server = "Microsoft-IIS/7.0";
"X-AspNet-Version" = "4.0.30319";
"X-Powered-By" = "ASP.NET";

}

百度谷歌stackoverflow哪里都找遍了,但都没解决,跪舔大触帮帮忙

高洛峰高洛峰2771 天前1403

全部回复(2)我来回复

  • 高洛峰

    高洛峰2017-04-18 09:35:13

    查一下服务器

    回复
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-18 09:35:13

    应该是Content-Type没有设置吧,还有请求格式等等都没有。500也可能使服务器的错。这是我看出的问题,希望有用。

    回复
    0
  • 取消回复