archiloque/rest-client — Issue #104: POST always has content_type 'application/x-www-form-urlencoded'?
Author: Cerales
Created: 2011-12-05 00:15:50+00:00
State: open

I'm using Rest-Client to submit a simple POST to CouchDB, with content-type application/json. Rest-Client UrlEncoded has this code, though:

````ruby
def headers
super.merge({'Content-Type' => 'application/x-www-form-urlencoded'})
end
````

Is there a way around this? I don't see why the content type should be messed with if the developer has specified it.

I'm calling it like this:

````ruby
RestClient.post uri, payload, headers, &block
````

Here are the parameters:

````ruby
URI: http://cerales:password@localhost:5984/testing
Payload: {"dan":true,"yep":1}
Headers: {:content_type=>:json, :accept=>:json}
````

Payload is a string, but I've tried it with a hash too.