title: ios Upload Image and Text using HTTP POST
body: <p>Thanks for reading.</p>
  
  <p>I am new to iOS and I am trying to upload an Image and a text using <code>multi-part form encoding</code> in iOS. </p>
  
  <p>The <code>curl</code> equivalent is something like this: <code>curl -F "param1=value1" -F "param2=@testimage.jpg" "<a href="http://some.ip.address:5000/upload" rel="noreferrer">http://some.ip.address:5000/upload</a>"</code></p>
  
  <p>The <code>curl</code> command above returns the expected correct response in <code>JSON.</code></p>
  
  <p><strong>Problem:</strong> 
  I keep getting a HTTP 400 request which means I am doing something wrong while composing the HTTP POST Body. </p>
  
  <p><strong>What I Did:</strong>
  For some reference, I tried  <a href="https://stackoverflow.com/questions/4683559/flickr-api-ios-app-post-size-too-large">Flickr API iOS app &quot;POST size too large!&quot;</a> and <a href="https://stackoverflow.com/questions/5422028/objective-c-how-to-upload-image-and-text-using-http-post">Objective C: How to upload image and text using HTTP POST?</a>. But, I keep getting a HTTP 400. </p>
  
  <p>I tried the <code>ASIHttpRequest</code> but had a different problem there (the callback never got called). But, I didn't investigate further on that since I've heard the developer has stopped supporting the library: <a href="http://allseeing-i.com/[request_release]" rel="noreferrer">http://allseeing-i.com/[request_release]</a>; </p>
  
  <p>Could someone please help me out?</p>