title: cURL request in Objective-C (POST)
body: <p>I'm struggling translating these cURL requests into Objective - C (I'll change the API keys later):</p>
  
  <p>Get request:</p>
  
  <pre><code> curl -v -H "app_id:4bf7860a" -H "app_key:0026e51c7e5074bfe0a0c2d4985804b2" -X GET "http://data.leafly.com/strains/blue-dream"
  </code></pre>
  
  <p>Post request:</p>
  
  <pre><code>curl -v -H "app_id:4bf7860a" -H "app_key:0026e51c7e5074bfe0a0c2d4985804b2" -X POST "http://data.leafly.com/strains" -d '{"Page":0,"Take":10}'
  </code></pre>
  
  <p>I've been able to get one successful request so far:</p>
  
  <pre><code>  NSURL *url = [NSURL URLWithString: [NSString stringWithFormat:@"http://data.leafly.com/strains/blue-dream"]];
      NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
      [request setHTTPMethod:@"GET"];
      [request setValue:@"application/json" forHTTPHeaderField: @"Content-Type"];
      [request addValue:@"4bf7860a" forHTTPHeaderField: @"APP_ID"];
      [request addValue:@"03d3eaa965c5809c5ac06a25505a8fe4" forHTTPHeaderField:@"APP_KEY"];
  
      NSURLSessionConfiguration *defaultConfigObject = [NSURLSessionConfiguration defaultSessionConfiguration];
      NSURLSession *session = [NSURLSession sessionWithConfiguration: defaultConfigObject delegate: nil delegateQueue: [NSOperationQueue mainQueue]];
  
      NSURLSessionDataTask *task = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
          NSLog(@"Data: %@",data);
  
          if (error) {
              NSLog(@"ERROR: %@", error);
          } else {
              NSDictionary *jSONresult = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:&amp;error];
              NSLog(@"Strain %@",jSONresult);
          }
      }];
      [task resume];
  </code></pre>
  
  <p>I'm just not able to piece together a comprehensive way to piece together these request consistently (I've tried <a href="http://unirest.io/objective-c.html" rel="nofollow">http://unirest.io/objective-c.html</a>).  Can anyone point me to a good resource or help me think through what I'm doing wrong?</p>