-1
How do I get the current path of an endpoint in the controller?
-1
How do I get the current path of an endpoint in the controller?
1
The object Request
has that information:
var route = Request.Path.Value;
Remembering that it is the relative path, without the protocol ( http
, etc.)
Browser other questions tagged c# api web-application
You are not signed in. Login or sign up in order to post.
In my project that Httprequestmessage does not have the Path.... You would know what it is?
– Alexandre Souza
means you don’t have the object
Path
?– Ricardo Pontual
I was with classic Web Api project (net framework) there to get the URL to use Request.RequestUri.Absolutepath, net Core is like you said. Which helped me because I needed to do this not two
– Alexandre Souza