title: setting content-type overwriting httpbody?
body: <p>I'm having a weird issue calling an API from my ios app. I create a post request</p>
  
  <pre><code>NSMutableURLRequest *request = [NSMutableURLRequest
                                  requestWithURL:url
                                     cachePolicy:NSURLRequestUseProtocolCachePolicy
                                 timeoutInterval:5.0];
  [request setHTTPMethod:@"POST"];
  </code></pre>
  
  <p>I then create json to send to the request and add it to the body of the request like so:</p>
  
  <pre><code>[request setHTTPBody:encodedData];
  </code></pre>
  
  <p>Finally, I am adding a few cookies which I then set with:</p>
  
  <pre><code>NSArray* cookieArray = [NSArray arrayWithObjects: sessionCookie, uidCookie, vidCookie, nil];
  NSDictionary * headers = [NSHTTPCookie requestHeaderFieldsWithCookies:cookieArray];
  [request setAllHTTPHeaderFields:headers];
  </code></pre>
  
  <p>This all works fine. However, since I am sending json I'm trying to be good and also set the content type with this line of code:</p>
  
  <pre><code>[request setValue:@"application/json; charset=utf-8" forHTTPHeaderField: @"Content-Type"];
  </code></pre>
  
  <p>As soon as I add this line of code, the data I sent to the body of the request no longer gets passed as part of the request. Does this sound like behavior anyone else has experienced?</p>