When to write a handler or module .. any examples?

I read about it, but still confused which use cases I will write with the http handler, not the http module (and vice versa). A few use cases for each will help.

+3
source share
2 answers

HTTP Handlers and HTTP Modules Overview

Typical uses for custom HTTP handlers include the following:

  • RSS feeds . To create an RSS feed for a website, you can create a handler that emits an XML format in RSS format. You can then associate a file name extension, such as .rss, with a custom handler. When users submit a request to your site that ends in .rss, ASP.NET calls the handler to process the request.

  • Image server . If you want a web application to serve images of different sizes, you can write your own handler to resize the images, and then send them to the user as a response from the handler.

Typical applications for HTTP modules include the following:

  • . , HTTP- , - XML . Internet Information Services (IIS) 7.0, , .

  • . HTTP- , , .

  • . , , , XML- -.

+1

HTTP ASPX. web.config URL-, "*.css" "MyHandler.xyz".

HTTP- . - , , HTTP-. .

0

Source: https://habr.com/ru/post/1788600/


All Articles