I am looking for a way to intercept/grab the request being made before matching to a route. For example, I have multiple controllers and routes set up, but I want some mecha
Like Joel Etherton mentioned in the comments, I think what you are looking for is something like adding the following code in your global.asax:
protected void Application_EndRequest()
{
/*
if(HttpContext.Current.Response.StatusCode == 404)
Debug.WriteLine("404 something something")
if(HttpContext.Current.Response.StatusCode == 500)
Debug.WriteLine("500 something something")
if(HttpContext.Current.Response.StatusCode == 200)
Debug.WriteLine("200 something something")
*/
Debug.WriteLine($"{context.Response.StatusCode} - {request.Url.PathAndQuery}");
}
I got my inspiration from here: ASP.NET MVC 404 Error Handling