Creating an asynchronous HTTP module

ASP.NET 4.5 provides us with the full C# language features described previously in Chapter 2, Exploring the Top New Features of the CLR. Also, the additional methods and features make it easier for us to work with asynchronous language features.

This helps enormously in writing asynchronous HTTP modules and handlers.

Performance is also improved, as the model is asynchronous; it doesn't keep the thread blocked until the request is completed.

Getting ready

In order to use this recipe you should have Visual Studio 2012.

How to do it...

We are going to create an asynchronous HTTP module. An HTTP module allows us to intercept HTTP requests for modifying those requests so we can generate a response in a customized way. ...

Get Microsoft .NET Framework 4.5 Quickstart Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.