title: Using accept header with NSMutableURLRequest on iOS
body: <p>I have a problem with my NSMutableURLRequest. My server supports both JSON and XML formats and they are separated with an access header. It also defaults to JSON if no access header is set.
  Which basically means that when I want the response in XML I need to create a request with 'application/xml' as access header.</p>
  
  <p>The problem I'm facing now is that even if I pass in the correct access header to get the response in XML I still end up with JSON (because that's default). It's like my request disregards the access header. Is there anything else I need to create in order to make my request work with headers?</p>
  
  <p>The request is really simple:<br>
  <code>NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];<br>
  [request setValue:@"application/xml" forHTTPHeaderField:@"Accept"];</code></p>
  
  <p>I have confirmed that my request contains my headers by printing allHTTPHeaderFields:<br>
  <code>headers:  {<br>
      Accept = "application/xml";<br>
  }</code></p>