title: Retrieve an Image from a POST request
body: <p>I am trying to send a picture to my java servlet (hosted on amazon ec2) to later transfer it to amazon s3 and wonder how to retrieve the Image from the post request.</p>
  
  <h2>Upload Code</h2>
  
  <p>The request is sent through iOS RestKit API like this (pic.imageData is a NSData type):</p>
  
  <pre><code>RKParams* params = [RKParams params];
  
  [params setValue:pic.dateTaken forParam:@"dateTaken"];
  [params setValue:pic.dateUploaded forParam:@"dateUploaded"];
  
  [params setData:pic.imageData MIMEType:@"image/jpeg" forParam:@"image"];
  
  [RKClient sharedClient].username = deviceID;
  [RKClient sharedClient].password = sessionKey;
  
  [RKClient sharedClient].authenticationType = RKRequestAuthenticationTypeHTTPBasic;
  
  uploadPictureRequest = [[RKClient sharedClient] post:kUploadPictureServlet params:params delegate:self];
  </code></pre>
  
  <h2>Parsing Code Stub</h2>
  
  <p>This is how I parse the other 2 parameters on the Java servlet:</p>
  
  <pre><code>double dateTaken = Double.parseDouble(req.getParameter("dateTaken"));
  double dateUploaded = Double.parseDouble(req.getParameter("dateUploaded"));
  </code></pre>
  
  <h2>Question</h2>
  
  <p>The question is: <strong>how do I retrieve and parse the image on my server?</strong></p>