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.

0

Supporting Multiple Authentication with Web API in the web hosted case

With the newly released Web API Beta bits ( http://www.asp.net/web-api), 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…

0

ASPNET WebAPI Beta has released

Watch Dan’s talk on the newly released WebAPI Beta. It is very cool!  https://channel9.msdn.com/Shows/Web+Camps+TV/Dan-Roth-on-the-new-ASPNET-Web-API The aspnet web api project can be found at http://aspnetwebstack.codeplex.com/.  A lot of new features i posted here are based on the latest bits.

2