I am sending data from my iPhone to server. Code is following:
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:url]];
[request setShouldCompressRequestBody:YES]; // gzip compression
[request setTimeOutSeconds:60];
[request setPostValue:emailString forKey:@"email"];
[request setPostValue:jsonStr forKey:@"jsonstring"];
[request setPostValue:pwd forKey:@"password"];
[request setDelegate:self];
[request startAsynchronous];
I tried to search that how can i receive this data in my server but couldn't find any help. Will i receive it using req.getParameter(). If yes then what will be the parameter name and then how to unzip it and use email, jsonstring, password parameters. Thanks in advance.
The easiest way (IMO) to do it in a standard J2EE environment is by using a GZIP compression filter. You can find some example in this question (although this one is only about response filter as far as I can see) or here (this one, I believe, can also do request decompression which you asked about).
You then plug such a filter into your webapp by using a
<filter>
element in yourweb.xml
(see here for an example of how to use servlet filters), thus avoiding any hardcoded dependencies from your webapp's code.