title: Path to RouteValueDictionary in Asp.Net Core
body: <p>I need to extract the route data (Controller, Action etc) from an <strong>arbitrary</strong> request path (<strong>not</strong> related to the current request) such as <em>/</em> or <em>/account/manage</em>. In previous versions of Asp.Net Mvc this could be accomplished like this:</p>
  
  <pre><code>var request = new HttpRequest(null, "http://localhost:3333/Home/About", "testvalue=1");
  var response = new HttpResponse(new StringWriter());
  var httpContext = new HttpContext(request, response);
  var routeData = RouteTable.Routes.GetRouteData(new HttpContextWrapper(httpContext));
  var values = routeData.Values;
  
  // The following should be true for initial version of mvc app.
  values["controller"] == "Home"
  values["action"] == "Index"
  </code></pre>
  
  <p><a href="https://stackoverflow.com/a/1831825/88513">Source</a></p>
  
  <p>This solution is not optimal since it requires a fully qualified Url instead of just a request path. </p>