我要發佈使用afnetworking此服務的一些數據,它的內容類型是application /肥皂+ xml.but我得到了錯誤AFNetworking POST和GET XML數據
Error Domain=AFNetworkingErrorDomain Code=-1011 "Request failed: internal server error (500)" UserInfo=0x9034f00 {NSErrorFailingURLKey=http://webapp.admin-inapp.com/services/FeedbackService.asmx?op=SendFeedback, AFNetworkingOperationFailingURLResponseErrorKey=<NSHTTPURLResponse: 0x8e31a00> { URL: http://webapp.admin-inapp.com/services/FeedbackService.asmx?op=SendFeedback } { status code: 500, headers {
"Cache-Control" = private;
"Content-Length" = 1666;
"Content-Type" = "application/soap+xml; charset=utf-8";
Date = "Fri, 23 May 2014 06:43:32 GMT";
Server = "Microsoft-IIS/8.0";
"X-AspNet-Version" = "4.0.30319";
"X-Powered-By" = "ASP.NET";
}},NSLocalizedDescription =請求失敗:內部服務器錯誤(500)}
這裏是我的代碼
NSString *string = [NSString stringWithFormat:@"http://webapp.admin-inapp.com/services/FeedbackService.asmx?op=SendFeedback"];
NSMutableDictionary *dict = [[NSMutableDictionary alloc]init];
[dict setObject:@"9888291933" forKey:@"Number"];
[dict setObject:self.textview.text forKey:@"Feedback"];
AFHTTPRequestOperationManager * manager = [AFHTTPRequestOperationManager manager];
[manager POST:string parameters:dict success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"%@",responseObject);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"%@",error);
}];
}
檢查此鏈接http://stackoverflow.com/questions/20402034/parsing-xml-with-afnetworking –
500錯誤表示出事了服務器處理您的請求.. – GoodSp33d
您可以發送您所要求的網址是什麼? – PREMKUMAR