mardi 26 janvier 2016

The content type 'application/x-www-form-urlencoded' is not supported in Ruby on Rails

So I'm just trying to make a simple post request using httpclient in RoR.

I'm going through a proxy, doing ntlm authentication with the server ( I can make GET requests without a problem).

Now when I try and do a post request, I get the error mentioned in the title...

proxy = ENV['HTTP_PROXY'] client=HTTPClient.new(proxy) client.set_auth(nil,user,pass) body= [{'Content-Type' => 'application/atom+xml, :content => ...}] res = client.post('url',body) puts res.body

How am i getting this error when I clearly specify the header as atom+xml..?




Aucun commentaire:

Enregistrer un commentaire