Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get page URL in Web API controller? [closed]

Site 1: test.page.com/News

Site 2: www.page.com/News

Site 3: m.site.com/News

Hi I 'm calling a pageapi.

Web Api url:http://www.pageapi.com/api/GetNews

How can I get website url(http://m.site.com/) in my Getnews api controller? Which page post my api?

I try Url.Request, Request.RequestUri,HttpContext.Current.Request.Path . But I 'didn't get. Always get web api url.

like image 733
user3583183 Avatar asked Mar 18 '23 03:03

user3583183


1 Answers

try:

HttpContext.Current.Request.UrlReferrer.AbsoluteUri
like image 62
MCurbelo Avatar answered Mar 23 '23 13:03

MCurbelo