开发者

question marks in sinatra get method

I am trying to use a question mark in one of my url's but sinatra/ruby is interpreting it as the regex character that makes precedings optional. Is there any way to allow actual ? in your get开发者_C百科 methods? I have tried \? and [?] but they didn't work. Here is the begining of my get method:

get '/group?groupid=:groupId' do |id|

If I go to www.mydomain.com/group?groupid=1 I get an error but it works if I go to www.mydomain.com/groupgroupid=1


The "?" starts the querystring portion of the URL; querystring parameters are accessible via the "params" Hash.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜