NSURLConnection POST calls GET rather than calling POST request
<p>I have been trying to send a post request to a server, but when I echo $_server['REQUEST_METHOD'] in the PHP file it echoes GET rather than POST.. I mean GET request method gets called and not POST</p>

<p>here is what I am doing:</p>

<pre><code>NSString *post = [NSString stringWithFormat:(NSString*)@"url=%@&amp;method=%@&amp;latency=%f", url, method, seconds];
NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];

NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]];

NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease];
[request setURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://www.domain.com/file.php"]]];
[request setHTTPMethod:@"POST"];
[request setValue:postLength forHTTPHeaderField:@"Content-Length"];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody:postData];

NSURLResponse *response = nil;
NSError *error = nil;

NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&amp;response error:&amp;error];
NSString *responseJSONStr = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
</code></pre>
