More

    Get request url in asp.net core api

    This Content Is Only For Subscribers

    Please subscribe to unlock this content. Enter your email to get access.
    Your email address is 100% safe from spam!
    using Microsoft.AspNetCore.Http.Extensions; 
    
    
    var url = httpContext.Request.GetEncodedUrl();
    or
    
    var url = httpContext.Request.GetDisplayUrl();
    depending on the purposes.
    //get request url in asp.net core
    using Microsoft.AspNetCore.Http.Extensions; 
    
    
    var url = httpContext.Request.GetEncodedUrl();
    //or
    var url = httpContext.Request.GetDisplayUrl();
    //or
    var url = HttpContext.Current.Request.Url.AbsoluteUri;

    Recent Articles

    spot_img

    Related Stories

    Stay on op - Ge the daily news in your inbox