title: POST request on iOS necessary headers
body: <p>I am sending a POST method from my iOS app. My code is working fine, but I just copy-pasted it. </p>
  
  <pre><code>NSString *post = @"key1=val1&amp;key2=val2";
  NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
  
  NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]];
  
  NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease];
  [request setURL:[NSURL URLWithString:@"http://www.nowhere.com/sendFormHere.php"]];
  [request setHTTPMethod:@"POST"];
  [request setValue:postLength forHTTPHeaderField:@"Content-Length"];
  [request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
  [request setHTTPBody:postData];
  </code></pre>
  
  <p><strong>My question is: Is it a must to set anything in the HTTP header field?</strong></p>
  
  <p>If yes, what header fields are necessary? </p>
  
  <p>Thanks!</p>