title: Response after JSON parsing in POST method giving code status 400 in iOS
body: <p>I am calling a web-service using <code>POST method</code> in Objective C (iOS). I am encoding the parameters in <code>NSUTF8StringEncoding</code> and then embedding it to the url. And I am getting response in <code>JSON format</code>. </p>
  
  <p>But the response I am getting is :
  <code>&lt;NSHTTPURLResponse: 0x8df87e0&gt; { URL: http://local.server/Servi1.svc/Register } { status code: 400, headers { "Content-Length" = 1675; etc etc..... Date, Server n all}}</code></p>
  
  <p>But the same URL in POST method when I am requesting in <code>Firefox REST Client</code>, I am getting the correct response. </p>
  
  <p>Can anyone help me out?</p>
  
  <pre><code>    {
       NSString * strBodyOnlineStart = [NSString
  stringWithFormat:@"mobile_key=%@&amp;key=%@",key,strId];
      urlOnlineStart = [NSURL
  URLWithString:@"http://local.server/Servi1.svc/Register"];
      NSMutableURLRequest *requestOnlineStart = [NSMutableURLRequest
  requestWithURL:urlOnlineStart];
      [requestOnlineStart setHTTPMethod:@"POST"];
      NSData *requestBodyOnlineStart = [strBodyOnlineStart
  dataUsingEncoding:NSUTF8StringEncoding];
      [requestOnlineStart setHTTPBody:requestBodyOnlineStart];
      NSURLResponse *responseOnlineStart = NULL;
      NSError *requestErrorOnlineStart = NULL;
      NSData *responseDataOnlineStart = [NSURLConnection
  sendSynchronousRequest:requestOnlineStart returningResponse:&amp;responseOnlineStart
  error:&amp;requestErrorOnlineStart];
  
      NSDictionary *jsonDictOnlineStart = [NSJSONSerialization
  JSONObjectWithData:responseDataOnlineStart options:kNilOptions error:nil];
  
    arrayOfQuestions = [ jsonDictOnlineStart objectForKey:@"data"];
  }
  </code></pre>