无法获得响应对象

时间:2016-12-23 05:14:13

标签: ios objective-c afnetworking

由于响应非常大,我无法从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(), ^{
    });
});

0 个答案:

没有答案