How to access HTTPContext from within your Web API action

Within a Web API action, you can easily access the HttpContext via the HttpContext.Current thread static. Alternatively, you can also retrieve the context from one of the properties in the Request message. Code Snippet HttpContext context; Request.Properties.TryGetValue<HttpContext>(“MS_HttpContext”, out context); Hope this helps.


Supporting Multiple Authentication with Web API in the web hosted case

With the newly released Web API Beta bits (, you can support multiple authentication from client. Say you want the client send both the username/password as well as Client Certificate for SSL. For the web hosted scenario, you can register a custom HTTP module to do the authentication and convert those client credentials into…


ASPNET WebAPI Beta has released

Watch Dan’s talk on the newly released WebAPI Beta. It is very cool! The aspnet web api project can be found at  A lot of new features i posted here are based on the latest bits.