title: How do I POST JSON data object to server in iOS5?
body: <p>I want to send a new object created on iOS to a receiving server with a <code>POST</code> method using <code>JSON</code> data type. From what I know about receiving data <strong>from</strong> the server in iOS, is that all <code>JSON</code> handling was simplified by Apple with the introduction of iOS 5. But in contradistinction to GETting JSON objects, POSTing those isn't really described anywhere I could find ...</p>
  
  <p>The first steps I took to try and solve the problem looked as follows:</p>
  
  <pre><code>    //build an info object and convert to json
      NSDictionary *newDatasetInfo = [NSDictionary dictionaryWithObjectsAndKeys:name, @"name", language, @"language", nil];
  
      //convert object to data
      NSData* jsonData = [NSJSONSerialization dataWithJSONObject:newDatasetInfo options:kNilOptions error:&amp;error];
  
      NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
      [request setURL:someURLSetBefore];
      [request setHTTPMethod:@"POST"];
      // any other things to set in request? or working this way?
  
      [[NSURLConnection alloc] initWithRequest:request delegate:self];
      // What to do with NSURLConnection? Or how to send differently?
  </code></pre>
  
  <p>But I really don't know how to <strong>send a JSON object to a server using a POST method</strong> at all.
  Could anybody please help me out?</p>