I would like to catch the path of my controller as a string in order to process every requests:
[ApiController]
[Route("[controller]")]
public class BackendController : ControllerBase
{
[Route("Backend/{url}")]
public Task<HttpResponseMessage> CatchAll(string url)
{
var requestmessage = HttpContext.Request;
//Do stuff
}
}
I found a lot of thing in asp.net core 2.1 but I didn't managed to make it work with my solution..
Thanks in advance
If you want to get the path of request,and process every requests,you can use middleware.
Here is a demo: