See Also: HttpRuntime Members
The HttpRuntime class drives the processing of an incoming request.To process a request an incoming HTTP request an object of type System.Web.HttpWorkerRequest is created. This object acts as a gateway between the System.Web runtime and the web server (two implementations are distributed with Mono: mod_mono to integrate with the Apache server and XSP a lightweight testing server).
The System.Web.HttpRequest.ProcessRequest (System.Web.HttpWorkerRequest) method drives the request. It determines based on the url what handler must be employed. Handlers are registered in the system.web/httpHandler section of the machine.config and per-directory Web.config files.
The request is then passed to the proper http handler. For example files ending in .aspx are processed by the internal PageHandlerFactory, files ending in .ashx are processed by the SimplerHandlerFactory and so on.
Users can define their own handlers by listing it on the web.config file like this:
Web.config Example
<configuration> <system.web> <httpHandlers> <add verb="GET" path="*.diff" type="GenerateCuteDiff.dll"/> </httpHandlers> </system.web> </configuration>In this example requests made with the HTTP GET method to files ending in the extension "diff" will be handled by GenerateCuteDiff type. The library must be available on either the GAC or the bin/ directory of the path where the file lives.
Handlers must implement the System.Web.IHttpHandlerFactory or System.Web.IHttpHandler interfaces.
Namespace: System.Web
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0