Recently I was building an API where I had to accept URLs as parameters in Grape routes. I URL-encoded the URL, but either my request would hit the wrong route, or it wouldn't capture anything after the second . in the URL, because it tries to parse that as a format ( .json for instance).

This is how I ended up fixing the problem:

resource :bookmarks do
    params do
      requires :url, type: String
    get 'check/:url', requirements: { url: /[\s\S]*/ } do

The requirements part is the important bit. We're using Regex to capture any string after check/ in the URL.