request.url returns me this : http://localhost:3000/page?foo=bar.
Is there a method I can call to get http://localhost:3000/page , or do I have to parse the string to strip get parameters?
request.url returns me this : http://localhost:3000/page?foo=bar.
Is there a method I can call to get http://localhost:3000/page , or do I have to parse the string to strip get parameters?
To get the request URL without any query parameters.
request.path
should return what you're looking for if you're not concerned about the hostname. Otherwise you might try:I use the following:
It does not regenerate the path, and therefore gives you exactly the url that the end-user sees in their browser, minus query parameters.