Why do we need Http handlers?

I understand that the HTTP handler handler processes the request, but that’s just a theory, because I don’t understand it. Many third-party controls require adding an http handler to web.config. And sometimes we need to create our own class using the ProcessRequest method, which implements the IHttpHandler interface, but I'm confused to understand where the Http handler fits and what are its roles?

+3
source share
2 answers

Http handlers are an integral part of ASP.NET - they process the request and generate a response . In web forms, it is typical for a page (aspx or possibly ashx) to interpret the request, but this is the type of handler (only displayed by default in the main web.config file).

In the case of adding handlers to the configuration file, this usually happens because the application dynamically generates content for URLs that do not magically display existing files, or add some logic for files that exist, but which are outside the normal asp .net.

If you use ASP.NET MVC, you usually need it much less (if at all), since this is the norm for queries not to display directly in aspx / ashx in the source tree.

- ASP.NET, , , - , , .. - , , aspx webforms.

+4

AJAX. XML/JSON, , , System.Web.UI.Page.

HTTP-, . , , .

0

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


All Articles