Remove .xml extension from ActiveResource request

Viewed 3450

I am trying to use ActiveResource to consume xml data from a third party API. I can use the RESTClient app to successfully authenticate and make requests. I coded my app and when I make a request I get a 404 error. I added:

ActiveResource::Base.logger = Logger.new(STDERR) 

to my development.rb file and figured out the problem. The API responds with xml data to requests that do NOT end in xml. EG, this works in RESTClient:

https://api.example.com/contacts

but ActiveResource is sending this request instead

https://api.example.com/contacts.xml

Is there anyway "nice" way to strip the extension from the request being generated by ActiveResource?

Thanks

4 Answers
Related