Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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.