title: How do I make Ruby's RestClient gem respect content_type on post?
body: <p>For instance, in the RestClient console:</p>
  
  <pre><code>RestClient.post 'http://localhost:5001', {:a =&gt; 'b'}, :content_type =&gt; 'application/json'
  </code></pre>
  
  <p>This does not send application/json as the content type. Instead I see:</p>
  
  <pre><code>Content-Type: application/x-www-form-urlencoded
  </code></pre>
  
  <p>I was able to trace the change to restclient/payload.rb:  </p>
  
  <pre><code>  class UrlEncoded &lt; Base
    ...
  
    def headers
      super.merge({'Content-Type' =&gt; 'application/x-www-form-urlencoded'})
    end
  end
  </code></pre>
  
  <p>Replacing super.merge with super causes the content type to be respected, but obviously that's not a real solution. Does anyone know the proper way to fix this? Thanks.</p>