I'm using rest-client (worst name ever for a google search) to query an API.
Here is my code :
def self.list
request="http://#{URI.escape @@user}:#{URI.escape @@password}@webservicedomain.com/params/params/"
Rails.logger.debug request
response = RestClient.get request
response.code
end
It give me the request i pass to Rest Client and then a 406 error :
MyService.list
http://username:password@webservicedomain.com/params/params/
RestClient::NotAcceptable: 406 Not Acceptable
Strange thing is, if i use the request in my browser it works fine. I think it may have to do with the fact this webservice only answer with HTML, but i'm not sure how to change that and test client does not really have a Doc.
Something great for starter, would be to see the header of the request rest-client sent.
How can i make it work ?
UPDATE
the exception thrown by rest-client after inspection contain the following error :
Invalid mime-type "*/*; q=0.5"