Asp. NET HTTP modules and handlers

Source: Internet
Author: User
Tags http request
Introduced
At the beginning of the internet age, the needs of clients are very limited;. htm files can meet their needs. However, over time, the expansion of client requirements extends beyond the functionality contained in. htm files or static files.
Developers need to expand or extend the functionality of the Web server. Web server vendors have designed different solutions, but all follow the same theme, "Inserting certain components into a Web server." All Web server supplemental technologies allow developers to build and insert components to enhance the functionality of the Web server. Microsoft has proposed the ISAPI (Internet Server API), Netscape has proposed NSAPI (Netscape Server API) and so on.
ISAPI is an important technology that allows us to enhance the ability of an ISAPI-compliant Web server (IIS is a Web server that is compatible with ISAPI). We use the following components to achieve this goal:
· ISAPI Extension
· ISAPI filters
ISAPI extensions are implemented using the WIN32 dynamic link library. You can think of an ISAPI extension as an ordinary application. The process target of the ISAPI extension is the HTTP request. This means you have to call them to activate them.
You can think of an ISAPI filter as just a filter. Each time the client makes a request to the server, the request passes through the filter. The client does not need to specify a filter in the request, simply send the request to the Web server, and the Web server passes the request to the relevant filter. The filter may then modify the request, perform some login operations, and so on.
Because of the complexity of these components, it is difficult to implement them. Developers have had to use C/COM + + to develop these components, but for many people, using C + + to develop is simply synonymous with pain.
So what does asp.net provide to achieve these functions? Asp. NET provides HttpHandler (HTTP handlers) and HttpModule (HTTP modules).
Before delving into the details of these components, it is valuable to understand how HTTP requests are processed through HTTP modules and HTTP handlers.
Building the sample application
I set up some of the following C # projects to demonstrate different components of the application:
· Newhandler (HTTP handler)
· Webapp (Demo HTTP handler)
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.