NSURL *url = [NSURL here`URLWithString:@"http://testing.appspot.com/json/ListingBusinessService/"];
AFHTTPClient *httpClient = [[AFHTTPClient alloc] initWithBaseURL:url];
httpClient.parameterEncoding = AFJSONParameterEncoding;
NSDictionary *params = @{@"params":@"women",@"params" : @"women", @"params":@"women"};
[httpClient registerHTTPOperationClass:[AFJSONRequestOperation class]];
[httpClient setDefaultHeader:@"Accept" value:@"application/json"];
[httpClient
postPath:@"getNewArrivalProductDetailsWithPaginationForIosApp"
parameters:params
success:^(AFHTTPRequestOperation *operation,id responseObject)
{
NSLog(@"%@",responseObject);
}
failure:^(AFHTTPRequestOperation *operation, NSError *error)
{
NSLog(@"%@",error);
UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"Error Retrieving Data"
message:[NSString stringWithFormat:@"%@",error]
delegate:nil
cancelButtonTitle:@"OK" otherButtonTitles:nil];
[av show];
}
];
我越來越而像上面這樣AFNetworkingOperationFailingURLRequestErrorKey代碼執行下面的錯誤而失敗,我想我失去了一些東西在參數,請建議我在這,在此先感謝。AFNetworking在Java Web服務
這段代碼的上下文是什麼?你試過什麼解決方案?請詳細說明您的問題,以獲得更好的幫助! –
什麼是錯誤?什麼不工作? –
我得到錯誤像AFNetworkingOperationFailingURLRequestErrorKey,錯誤它的打印整個JSON,但在失敗塊 – user2667982