get request url in asp.net core code example
Example 1: get request url in asp.net core
using Microsoft.AspNetCore.Http.Extensions;
var url = httpContext.Request.GetEncodedUrl();
or
var url = httpContext.Request.GetDisplayUrl();
depending on the purposes.
Example 2: get request url in asp.net core
var url = HttpContext.Current.Request.Url.AbsoluteUri;