Searching the web for some method to send POST requests in Objective-C, I came up with some solutions.
That's what I've got:
responseData = [NSMutableData new]; NSURL *url = [NSURL URLWithString:@"http://mydomain.com/page.php?"]; NSString *myParameters = [[NSString alloc] initWithFormat:@"str=hello"]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0]; [request setHTTPMethod:@"POST"]; [request setHTTPBody:[myParameters dataUsingEncoding:NSUTF8StringEncoding]]; The response I receive is an error, because the POST variable "str" hasn't been set.
What am I doing wrong?