The HttpRequestExtensions is a Nuget Package for getting absolute or relative url. This library return absolute and relative url from HttpRequest.
using HttpRequestExtensions;
HttpContext.Request.GetAbsoluteUri();
or
HttpContextExtensions.GetAbsoluteUri(HttpContext.Request);
HttpContext.Request.GetAbsoluteUriWithQueryString();
or
HttpContextExtensions.GetAbsoluteUriWithQueryString(HttpContext.Request);
HttpContext.Request.GetRelativePathWithQueryString();
or
HttpContextExtensions.GetRelativePathWithQueryString(HttpContext.Request);