title: From iphone app to face.com api: upload raw image
body: <p>I just test the face.com face recognition api and I have success with json requests:</p>
  
  <pre><code>NSString *url = @"http://api.face.com/faces/detect.json?api_key=myapi&amp;api_secret=mysecret&amp;urls=http://userserve-ak.last.fm/serve/_/47363849/Christina+Aguilera+HQ+PNG.png";
  
  // Create new SBJSON parser object
  SBJsonParser *parser = [[SBJsonParser alloc] init];
  
  NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:url]];
  
  // Perform request and get JSON back as a NSData object
  NSData *response = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
  
  // Get JSON as a NSString from NSData response
  NSString *json_string = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
  
  // parse the JSON response into an object
  // Here we're using NSArray since we're parsing an array of JSON status objects
  NSDictionary *obj = [parser objectWithString:json_string];
  
  //
  NSString *status = [obj objectForKey:@"status"];
  
  //
  NSLog(@"status: %@", status);
  </code></pre>
  
  <p>This works when I pass the api key, secret and the IMAGE ON THE WEB as GET params, like:</p>
  
  <pre><code>http://api.face.com/faces/detect.json?api_key=4b4b4c6d54c37&amp;api_secret= &amp;urls= http://farm3.static.flickr.com/2566/3896283279_0209be7a67.jpg
  </code></pre>
  
  <p>Now, I want to upload a raw image data from my app...but this is not so well documented on the site:</p>
  
  <p><a href="http://developers.face.com/docs/api/faces-detect/" rel="nofollow">http://developers.face.com/docs/api/faces-detect/</a></p>
  
  <p>There it says:</p>
  
  <p>Code:
  Optional    [no name]   The raw image data for the photo (when instead of url, an image is uploaded)</p>
  
  <p>This is the problem:</p>
  
  <p>How do I pass the raw data as POST along with the apikey and secret? 
  I know it must be as POST, but how?</p>