I'm requesting data from the server but I have an issue that it is calling the cookie first than the data unlike it should be data first than cookie. So please how can I fix this issue?
I've seen this issue via Charles application.
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
[manager POST:string
parameters:@{@"data": @"<p_LM act=\"info\"/>", @"cookie": [temp objectForKey:@"cookie"]}
success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSDictionary *dic = (NSDictionary *)responseObject;
NSString *parity = [dic objectForKey:@"Response"];
}
Parameters
isNSDictionary
. When AF serialize the request it uses alphabetical sort descriptor forNSDictionary
:So, you have two choices:
AFQueryStringPairsFromKeyAndValue
method of the AF pod and take care of it when you dopod update
.edited to specify the second way
if you want to change the AFNetworking code pod to make it work for you then do:
search for AFQueryStringPairsFromKeyAndValue method in AFNetworking pod
change e.g.
to
(just change alphabetical sorting from bottom to top)
and then if you will update your AFNetworking pod next time after a year or earlier then just add this change again because your change will be overridden by the new pod update ...