title: Not getting JSON response using content-type application/JSON iOS
body: <p>I have been provided with a <code>REST</code> service from my customer for which I should get <code>JSON</code> response for my iOS code.I am using <code>content-type</code> as "application/json" but somehow it is taken as "text/html" by default.  I cross checked this in a <code>REST</code> client in my Mozilla browser using "application/json" for the <code>content-type</code> in header section and I could see the proper response.On using the below code, I am getting a <code>400</code> error from the server. I could always see "text/html" as being used as part of the <code>400</code> response by default</p>
  
  <pre><code>NSString * strBodyOnlineStart = [NSString stringWithFormat:@"&amp;email=***@***.com&amp;deviceCode=*****&amp;password_value=***"];
  
        NSURL *urlOnlineStart = [NSURL
                            URLWithString:@"http://local.server/xxxxx"];
          NSMutableURLRequest *requestOnlineStart = [NSMutableURLRequest
                                                     requestWithURL:urlOnlineStart];
  
  
          [requestOnlineStart setValue:@"application/json" forHTTPHeaderField:@"Accept"];
          [requestOnlineStart setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
  
          [requestOnlineStart setHTTPMethod:@"POST"];
          NSData *requestBodyOnlineStart = [strBodyOnlineStart
                                            dataUsingEncoding:NSUTF8StringEncoding];
          [requestOnlineStart setHTTPBody:requestBodyOnlineStart];
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/JW8Yp.png" alt="Below is the response which I am getting from the server"></p>