What is the difference between Request.RawUrl
and Request.Url
in ASP.NET?
The raw URL is defined as the part of the URL following the domain information. In the URL string http://www.contoso.com/articles/recent.aspx , the raw URL is /articles/recent. aspx. The raw URL includes the query string, if present.
How can I get the raw URL for these files? You can just type the name of the file at the end of the path. Get the URL for your text file and replace the filename/path with the path to your datafile. Cyverse might be a little easier since you should be able to upload a single directory of your hub data (including hub.
No one seems to have mentioned that it shows the Raw URL actually received by IIS, before any manipulation may have happened sending it around IIS or your file system with URL rewriting for example.
Say you have set an error page at /error
in an MVC app and you set your webconfig to replace error pages with your custom error page at that location. In this way when getting an error at /faultypage
, the user will get the page at /error
but the url in your browser's address bar will still say www.mysite.com/faultypage
—this is a transfer, or a rewrite.
Now on your error controller if you are to take a peek at Request.Url
, it will be something like www.mysite.com/error
and Request.RawUrl
would say (more usefully?) /faultypage
which is the user's actual request not the page that is currently being executed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With