title: Converting a CURL command for Objective C
body: <p>I'm having a difficulty transforming this curl command for my Objective C Code:</p>
  
  <pre><code>curl -u 0ef106c78146a23becba9105d1e:X -H "Accept: application/json" -H "Content-Type: application/json" https://boomboom.c27.imonggo.com/api/products.json
  </code></pre>
  
  <p>Here's my objective C code:</p>
  
  <pre><code>NSError *theError = NULL;
  NSURL *theURL = [NSURL URLWithString:@"https://boomboom.c2.imonggo.com/api/products.json"];
  NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:theURL cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:10.0f];
  [theRequest setValue:@"0ef106c78146a23becba9105d1e" forHTTPHeaderField:@"username"];
  [theRequest setValue:@"x" forHTTPHeaderField:@"password"];
  [theRequest setValue:@"application/json" forHTTPHeaderField:@"Accept:"];
  [theRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type:"];
  
  
  NSURLResponse *theResponse = NULL;
  NSData *theResponseData = [NSURLConnection sendSynchronousRequest:theRequest returningResponse:&amp;theResponse error:&amp;theError];
  </code></pre>
  
  <p>Most likely my problem is with the header fields.</p>