0
我正在使用NSURLConeection消耗服務,現在我正在切換到AFNetworking,但得到一些奇怪的錯誤。我的代碼 注:CTPHTTPClient是AFHTTPClient的子類AFNetworking在NSError對象返回響應
NSDictionary *parameters = @{
@"email" : @"[email protected]",
@"confirmPassword" : @"12345",
@"userName" : @"mithilesh",
@"password" : @"12345",
@"termsAndConditionAccepted" : @1,
@"dob" : @"1190-03-05"
};
[[CTPHTTPClient sharedCTPHTTPClient] postPath:@"signup.json"
parameters:parameters
success: ^(AFHTTPRequestOperation *operation, id JSON){
NSLog(@"Res = %@",JSON);
}
failure:^(AFHTTPRequestOperation *operation, NSError *error){
[CTPUtilities showAlert:[error localizedDescription] delegate:self];
}];
響應
在上面的反應,你可以看到紅色的長方形它包含有效響應。我在使用NSURLConnection時正確得到它。