title: Rest-Client: how to post multipart/form-data?
body: <p>I have to implement the curl POST request below listed, in Ruby, using Rest-Client. </p>
  
  <p>I have to:</p>
  
  <ul>
  <li>send params in header;</li>
  <li><p>send params (that do not contain a file) as <code>multipart/form-data</code>:</p>
  
  <pre><code>$ curl -X POST -i -H "Authorization: Bearer 2687787877876666686b213e92aa3ec7e1afeeb560000000001" \
      https://api.somewhere.com/endpoint -F sku_id=608399
  </code></pre></li>
  </ul>
  
  <p>How can I translate the curl request using the RestClient rubygem?</p>
  
  <p>Reading documentation (multipart paragraph): <a href="https://github.com/rest-client/rest-client" rel="nofollow">https://github.com/rest-client/rest-client</a>
  I coded as:</p>
  
  <pre><code>@access_token = 2687787877876666686b213e92aa3ec7e1afeeb560000000001
  url = 'https://api.somewhere.com/endpoint'
  req = { authorization: "Bearer #{@access_token}"}
  
  
  RestClient.post url, req, {:sku_id =&gt; 608399, :multipart =&gt; true}
  </code></pre>
  
  <p>But I get a server error; is the Ruby code above correct?</p>
  
  <p>Thanks a lot,
  Giorgio</p>