How can I extract the scheme, host, path, and query string from the HTTP Referer using C#?
I'm currently working on a simple ASP.NET Core MVC 6 application and getting the HTTP Referer using Context.Request.Headers["Referer"].ToString().The value of the HTTP referer is http://localhost:5050/Blogs/Details/3 and I'm wondering how I can extract http for the scheme, localhost:5050 for the host (including port), and /Blogs/Details/3 for the path.
Is there anything in ASP.NET Core framework or C# that can do this? Or do I need to manually separate the HTTP Referer string?