我遇到了這個問題2天,Android應用程序可以很好地使用這個後臺界面,但我總是收到500錯誤。我的代碼是這樣的。代碼= -1011「請求失敗:內部服務器錯誤(500)
AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
manager.requestSerializer = [AFJSONRequestSerializer serializer];
manager.responseSerializer = [AFHTTPResponseSerializer serializer];
manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/html"];
[manager POST:urlString parameters:self.param.mj_keyValues success:^(NSURLSessionDataTask *task, id responseObject) {
....
} failure:^(NSURLSessionDataTask *task, NSError *error) {
....
}];
,然後,該程序進入故障塊,我也得到NSError登錄這個樣子。
Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: internal server error (500)" UserInfo={com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x7fc26b49a080> { URL: https://training.duapp.com/record_data } { status code: 500, headers {
Server = openresty;
Content-Type = text/html;charset=utf-8;
Vary = Accept-Encoding;
Content-Language = en;
Date = Fri, 02 Sep 2016 03:55:00 GMT;
Content-Encoding = gzip;
Content-Length = 646;
Connection = keep-alive;
}
}, NSErrorFailingURLKey=https://training.duapp.com/record_data, com.alamofire.serialization.response.error.data=
然後我試圖修女從NSDictionary中到的NSData或NSString的帕拉姆,並改變requestSerializer它,但全部失敗,錯誤500.該參數的格式沒有錯誤,這與我的b一致ackground workmate.Can I can help you from you?我該怎麼辦?
可以yiu顯示一些額外的代碼 –