If you are using HttpServer (not selfhost or webhost), Request.GetRequestContext() always returns null. We use HttpServer for quick in-memory testing. It would be useful to maintain same behavior for HttpServer for consistency.
Comments: Repro code, ``` public class Test { [Fact] public void TestRequestContext_HttpServer() { HttpServer server = new HttpServer(); server.Configuration.MapHttpAttributeRoutes(); HttpClient client = new HttpClient(server); var response = client.GetAsync("http://localhost/Customers").Result; response.EnsureSuccessStatusCode(); } } public class CustomersController : ApiController { [Route("Customers")] public void Get() { Assert.NotNull(Request.GetRequestContext()); } } ```
Comments: Repro code, ``` public class Test { [Fact] public void TestRequestContext_HttpServer() { HttpServer server = new HttpServer(); server.Configuration.MapHttpAttributeRoutes(); HttpClient client = new HttpClient(server); var response = client.GetAsync("http://localhost/Customers").Result; response.EnsureSuccessStatusCode(); } } public class CustomersController : ApiController { [Route("Customers")] public void Get() { Assert.NotNull(Request.GetRequestContext()); } } ```