title: AFNetworking issue: NSErrorFailingURLKey=url, NSLocalizedDescription=Request failed: bad request (400)
body: <p>I am calling POST and sending nested JSON to the server as follows:</p>
  
  <pre><code>NSDictionary* jsonDict = @{@"user":@{@"accountId":@0,@"active":@NO,@"createdBy":@0,@"createdOn":@"", @"emailAddress":@"", @"firstName":@"", @"gender":@0, @"id":@9, @"lastName":@"", @"role":@5,},@"punchInLocation": @"",
                             @"punchInLatitude": @18.5081214,
                             @"punchInLangitude": @73.8431377,
                             @"punchOutLocation": @"",
                             @"punchOutLatitude":@0,
                             @"punchOutLagitude": @0,
                             @"punchInLocationNotFoundReason": @"NetworkProblem",
                             @"punchOutLocationNotFoundReason": @"",
                             @"sdate": @"2014-12-10",
                             @"spunchInTime": @"08:37:44"
                             };
  
  AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
  manager.requestSerializer = [AFJSONRequestSerializer serializer];
  [manager.requestSerializer setValue:@"&lt;&lt;removed&gt;&gt;" forHTTPHeaderField:@"userToken"];
  manager.responseSerializer = [AFHTTPResponseSerializer serializer];
   manager.responseSerializer.acceptableContentTypes = [manager.responseSerializer.acceptableContentTypes setByAddingObject:@"application/json"];
  [manager.requestSerializer setValue:@"application/json" forHTTPHeaderField:@"Accept"];
  [manager.requestSerializer setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
  [manager POST:@"&lt;&lt;removed&gt;&gt;" parameters:json success:^(AFHTTPRequestOperation *operation, id responseObject) {
      NSLog(@"JSON: %@", responseObject);
  } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
      NSLog(@"Error: %@", error);
  }];
  </code></pre>
  
  <p>But I am getting error as below</p>
  
  <pre><code>{ status code: 400, headers {
  "Access-Control-Allow-Origin" = "http://onboard.qlc.in";
  "Cache-Control" = public;
  Connection = close;
  "Content-Encoding" = gzip;
  "Content-Length" = 393;
  "Content-Type" = "text/html;charset=utf-8";
  Date = "Mon, 18 May 2015 09:24:50 GMT";
  Server = "Apache/2.2.15 (CentOS) DAV/2 mod_jk/1.2.40";
  Vary = "Accept-Encoding,User-Agent";
  } 
  }, NSErrorFailingURLKey=url, NSLocalizedDescription=Request failed: bad request (400)
  </code></pre>
  
  <p>Thanks in advance</p>