标签: c# .net
我使用红隼。
Reference
您是否有具体的实施示例?
答案 0 :(得分:2)
我用它来查找ASP.NET Core API控制器的请求路径:
var httpFeatures = HttpContext.Features.Get<IHttpRequestFeature>(); if (httpFeatures == null) { string path = httpFeatures.Path; }
返回路径“/ api / client / ipaddress / islocal”
参考:https://docs.microsoft.com/en-us/aspnet/core/api/microsoft.aspnetcore.http.features.ihttprequestfeature