由于响应非常大,我无法从api获得响应。下面的代码给出了内部服务器错误,但在休息时客户端运行正常。
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
manager.responseSerializer = [AFJSONResponseSerializer serializer];
manager.requestSerializer = [AFJSONRequestSerializer serializer];
manager.securityPolicy.allowInvalidCertificates = YES;
[manager GET:constantString parameters: nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"POST data JSON returned: %@", responseObject);
jsonArrayNew = responseObject;
[[UIApplication sharedApplication] endIgnoringInteractionEvents];
}
failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"Error: %@", error);
}];
dispatch_async(dispatch_get_main_queue(), ^{
});
});