I'm using AFNetwrorking. After sending request sometimes i get
Error: Error Domain=NSURLErrorDomain Code=-1005 "Network connection is lost."
Even when internet is available sometimes it randomly occurs. The second or the third try the request works.
Is there any way to restart this request if the first one fails. I mean is there a parameter in operationManager to set the number of tries?
here is how im using AFNetworking:
AFHTTPRequestOperationManager *operationManager = [AFHTTPRequestOperationManager manager];
operationManager.requestSerializer = [AFJSONRequestSerializer serializer];
operationManager.responseSerializer = [AFJSONResponseSerializer serializer];
operationManager.responseSerializer.acceptableContentTypes = [operationManager.responseSerializer.acceptableContentTypes setByAddingObject:@"text/html"];
[operationManager POST:URL
parameters:parameters
success:^(AFHTTPRequestOperation *operation, id responseObject) {
......