如何在 Web API 控制器中获取页面 URL?

How to get page URL in Web API controller?

站点 1:test.page.com/News

站点 2:www.page.com/News

站点 3:m.site.com/News

您好,我正在呼叫页面api。

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

如何在我的 Getnews api 控制器中获取网站 url(http://m.site.com/)?哪个页面 post 我的 api?

我尝试 Url.Request、Request.RequestUri、HttpContext.Current.Request.Path。但我没有得到。始终获取网络 api url.

尝试:

HttpContext.Current.Request.UrlReferrer.AbsoluteUri