2

I'm having trouble debugging a client, and I'm trying to get the raw URL on the server which is in rails. I'm wondering how I can dump the raw URL/http message that is hitting rails.

If found query_string, which works okay for gets. But if a user does a post, I can't seem to find the raw string anywhere.

All I can find is post-parsed parameters in hashes vs raw URLs.

Help?

John Hinnegan
  • 5,864
  • 2
  • 48
  • 64

1 Answers1

6
request.url 

Will give the current url.

See other answers:

How do I get the current absolute URL in Ruby on Rails?

Community
  • 1
  • 1
thenengah
  • 42,557
  • 33
  • 113
  • 157
  • 1
    This doesn't actually return the raw URL. For example, if there's a trailing / on the original request, it'll be missing. `request.env['REQUEST_PATH']` is a less altered path, though it doesn't include the host. – Barry Kelly Nov 11 '20 at 11:36