Our app provides an API that people can use to submit URLs like this:
curl -X POST http://app.local/resource -d'url=http://news.google.com/newshl=en&q=obama&um=1&ie=UTF-8&output=rss'
Unfortunately, it seems that Rails messes up with this param. Any idea on how to fix this?
See the log below :
Processing ApplicationController#index (for 127.0.0.1 at 2010-06-08 19:03:09) [POST]
Parameters: {"um"=>"1", "url"=>"http://news.google.com/newshl=en", "output"=>"rss", "q"=>"obama", "ie"=>"UTF-8"}
I would expect the following :
Parameters: {"url"=>"hhttp://news.google.com/newshl=en&q=obama&um=1&ie=UTF-8&output=rss"}
What exactly Rails messes up?
If you are referring to the fact that it didn’t get complete Google URL (i.e. separated it to output, q and other params) that’s because you need to encode ‘&’ character if you want to use it as a part of a value. Something like: