开发者

Ruby on Rails query string with special chars

开发者 https://www.devze.com 2023-03-12 01:05 出处:网络
I am having code as follows in my rest_api controller which calls api method using active resource...

I am having code as follows in my rest_api controller which calls api method using active resource...

@getResponse = api.get(:response, :apiKey => "GKIN1DOM00JXI66LFH5A", :userId => "111-693282-81705419", :token =>"u:sdhfgjsT:sdfgsjdf")

========================================================================================== In above code when resource url is hit, it converts ":" to "%3A" due to which api fails to get the token and returns error as 401 (resource url hit - http://my-api/api/response.josn?apikey=hdsfjdf&token=u%开发者_StackOverflow中文版3A sdhfgjsT*%3A* sdfgsjdf where is sould be http://my-api/api/response.josn?apikey=hdsfjdf&token=u : sdhfgjsT : sdfgsjdf)

Please help, to stop escaping my query string params


Easiest solution that comes to my mind is: "string".html_safe

0

精彩评论

暂无评论...
验证码 换一张
取 消