title: POST API call having trouble with JSON body
body: <p>I'm trying to connect to an API and I keep getting an error saying that I'm not including the client_id in the call. Here's the code:</p>
  
  <pre><code>+ (void)connectWithUsername:(NSString *)username Password:(NSString *)password Type:(NSString *)type Email:(NSString *)email
  {
      NSString *urlString = [kTestAPI stringByAppendingString:@"connect"];
      NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:urlString]];
  
      NSDictionary *params = @{@"client_id":client,
                           @"secret":secret,
                           @"credentials":@{@"username":username,@"password":password},
                           @"type":type,
                           @"email":email};
      NSLog(@"PARAMS: %@", params);
      NSData *jsonData = [NSJSONSerialization dataWithJSONObject:params options:0 error:nil];
      request.HTTPMethod = @"POST";
      request.HTTPBody = jsonData;
  
      [NSURLConnection sendAsynchronousRequest:request
                                         queue:[NSOperationQueue mainQueue]
                             completionHandler:^(NSURLResponse *response, NSData *data, NSError *error)
       {
           NSDictionary *output = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:nil];
           NSLog(@"SUCCESS: %@", output);
       }];
  }
  </code></pre>
  
  <p>Here's the output:</p>
  
  <pre><code>2014-08-23 11:52:53.131 Balance[11538:60b] PARAMS: {
      "client_id" = "test_id";
      credentials =     {
          password = "plaid_good";
          username = "plaid_test";
      };
      email = "test@plaid.com";
      secret = "test_secret";
      type = wells;
  }
  
  2014-08-23 11:52:53.554 Balance[11538:60b] SUCCESS: {
      code = 1100;
      message = "client_id missing";
      resolve = "Include your Client ID so we know who you are.";
  }
  </code></pre>
  
  <p>Initially, I thought it might be because the client_id is showing up in quotes when I NSLog it, but after doing some searching I found that apparently that is just a function of the description method that is called from NSLog since client_id has an underscore so it's not considered alphanumeric thus quotes are added, thus should not affect the JSON, I think. So, yeah I'm stumped, any help would be appreciated :)</p>