When I do a post request from my mobile app to the rails server while using NSURLRequestUseProtocolCachePolicy I don’t get the params, only the controller name and the action name. But when I use NSURLRequestReloadIgnoringCacheData I properly get all the params printed on the console by using puts params.
This is how I am doing the post in my iOS application.
NSURL *aUrl = [NSURL URLWithString:@"http://developer.idlecampus.com/devices"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:aUrl
cachePolicy:NSURLRequestReloadIgnoringCacheData
timeoutInterval:60.0];
[request setHTTPMethod:@"POST"];
NSString *postString = [NSString stringWithFormat:@"registration_id=%@&device_identifier=%@&device_type=IOS",registration_Id,device_identifier];
[request setHTTPBody:[postString dataUsingEncoding:NSUTF8StringEncoding]];
NSURLConnection *connection= [[NSURLConnection alloc] initWithRequest:request
delegate:self];