What is the ASP.NET Core MVC equivalent to Request.RequestURI?

Personally, I use :

new Uri(request.GetDisplayUrl())
  • GetDisplayUrl fully un-escaped form (except for the QueryString)
  • GetEncodedUrl – fully escaped form suitable for use in HTTP headers

These are extension method from the following namespace : Microsoft.AspNetCore.Http.Extensions

Leave a Comment