关闭。这个问题需要details or clarity .它目前不接受答案。
想改善这个问题吗?通过 editing this post 添加详细信息并澄清问题.
6年前关闭。
Improve this question
站点 1:test.page.com/News
站点 2:www.page.com/News
站点 3:m.site.com/News
嗨,我正在调用 pageapi。
Web Api 网址:http://www.pageapi.com/api/GetNews
如何在我的 Getnews api Controller 中获取网站 url( http://m.site.com/ )?哪个页面发布了我的api?
我尝试 Url.Request, Request.RequestUri,HttpContext.Current.Request.Path 。但我没有得到。始终获取 web api url。
最佳答案
尝试:
HttpContext.Current.Request.UrlReferrer.AbsoluteUri
关于url - 如何在 Web API Controller 中获取页面 URL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28368328/