title: How to upload image with parameters using Alamofire in Swift
body: <p>I am developing an iPhone application with swift. and I'am using <a href="https://github.com/Alamofire/Alamofire" rel="noreferrer">Alamofire framework</a> for handling http requests. I use <code>Alamofire.request</code> for POST , GET and etc like this:</p>
  
  <pre><code>Alamofire.request(.POST, myURL , parameters: ["a": "1", "b" : "2" ])
          .response { (request, response, data, error) in
  }  
  </code></pre>
  
  <p>And I use <code>Alamofire.upload</code> to upload image to server this :</p>
  
  <pre><code>Alamofire.upload(.POST, uploadURL , fileURL)
  </code></pre>
  
  <p>And both works perfectly, but now I want to upload an image and also send some parameters with, and my content type should be <code>multipart/form-data</code> and <code>Alamofire.upload</code> does not accept parameters.</p>
  
  <p>There are two more question on SO about this issue with swift, which <a href="https://stackoverflow.com/questions/26162616/upload-image-with-parameters-in-swift">first one</a> is not using Alamofire (and really, why not?) and in <a href="https://stackoverflow.com/questions/26121827/uploading-file-with-parameters-using-alamofire">second one</a>, <a href="https://stackoverflow.com/users/157142/mattt">mattt</a> (Alamofire Developer) cited to use encoding parameters.</p>
  
  <p>I checked his example, but still couldn't figure out how to do that.</p>
  
  <p>Can any one please help me solve this problem?</p>
  
  <p>Thank you! :)</p>