I have the following code:
NSDictionary *parameters = @{@"parameter1":objectVariable1,@"parameter2":objectVariable2};
[MANAGER POST:@"http:www.myserver.com/somelink" parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject)
{
//PROCESS RESPONSE
}
failure:^(AFHTTPRequestOperation *operation, NSError *error)
{
//PROCESS FAILURE
}];
In case of failure how do I retry this connection considering the objectVariable1 & objectVariable2 can change at any point (while the connection is sent to the server) thus the same post parameters as before must be sent.
Can the parameters be obtained from AFHTTPRequestOperation *operation
in the error branch?
Just to be sure, for example, this can be the case:
- objectVariable1 = 1
- send connection with objectVariable1 = 1
- objectVariable1 = 2
- connection fails and should retry with objectVariable1 = 1