title: HTTParty: Upload files
body: <p>How would I do the following <code>curl</code> call using <a href="https://github.com/jnunemaker/httparty" rel="nofollow noreferrer">HTTParty</a>?</p>
  
  <pre><code>$ curl -u andrew.lunny@nitobi.com -F keystore=@android.keystore -F 'data={"title":"Android Key","alias":"release", "key_pw":"90123456","keystore_pw":"78901234"}' https://build.phonegap.com/api/v1/keys/android
  </code></pre>
  
  <p>Here is what I currently have:</p>
  
  <pre><code>HTTParty.post("https://build.phonegap.com/api/v1/keys/android?auth_token=#{phonegap_token}", query: { keystore: file }, body: { data: {
      title: 'Android Key',
      alias: '...',
      key_pw: '...',
      keystore_pw: '...'
  } }, format: :plain)
  </code></pre>
  
  <p><code>file</code> is a <code>Tempfile</code> object which I fetched from the cloud storage where the file is located.</p>
  
  <p>I want to pass a file which has been uploaded using Carrierwave and stored using Fog. Do I have to fetch it first from the URL?</p>