Questions tagged [httphandler]

HttpHandlers are classes that implement the IHttpHandler and IHttpAsyncHandler interfaces. This section describes how to create and register HttpHandlers and provides examples of a synchronous handler, an asynchronous handler, and a handler factory.

ASP.NET Request Processing

Introduces ASP.NET handling of HTTP requests.

Creating HttpHandlers

Discusses the creation of synchronous and asynchronous HttpHandlers.

Registering HttpHandlers

Describes how ASP.NET is configured to call an HttpHandler.

HttpHandler Factory

Describes how to generate a new handler instance for each HTTP request.

Related Sections

HTTP Runtime Support

Provides an overview of how to use IHttpModule and IHttpHandler interfaces. 

HttpModules

Provides an overview of HttpModules. 
1249 questions
12
votes
3 answers

Receiving a HTTP POST in HTTP Handler?

I need to listen and process a HTTP POST string in a HTTP handler. Below is the code for posting the string to handler - string test = "charset = UTF-8 & param1 = val1 & param2 = val2 & param3 = val3 & param4 = val4; byte[] data =…
Sandy
  • 2,429
  • 7
  • 33
  • 63
12
votes
4 answers

Response.Flush() throws System.Web.HttpException

I have a HttpHandler that I'm using to handle certain images on a client's website. When I'm outputting the image stream to the response object and call Flush occasionally an error is thrown. Here is a codeblock var image =…
Anthony Shaw
  • 8,146
  • 4
  • 44
  • 62
12
votes
2 answers

HttpHandler not working in IIS 7

I have an HttpHandler configured in my web.config file like so: When I deploy to IIS 7 the handler stops working (404). What do I…
Ronnie Overby
  • 45,287
  • 73
  • 267
  • 346
12
votes
3 answers

HttpHandler not being called

I need to write a HttpHandler that will serve up JavaScript files which are embedded resources in .DLLs in my project. A reference in a view cannot directly see such a resource, so I planned to use a HttpHandler module that would intercept any…
Quango
  • 12,338
  • 6
  • 48
  • 83
12
votes
4 answers

When is a Generic HttpHandler (an ashx, the IHttpHandler interface) reusable?

I've been using Ashx along with jQuery. I've read msdn, I'm talking about the IHttpHandler.IsReusable Property. Gets a value indicating whether another request can use the IHttpHandler instance. What do they mean "the IHttpHandler instance."?…
Royi Namir
  • 144,742
  • 138
  • 468
  • 792
11
votes
3 answers

Call the default asp.net HttpHandler from a custom handler

I'm adding ASP.NET routing to an older webforms app. I'm using a custom HttpHandler to process everything. In some situations I would like to map a particular path back to an aspx file, so I need to just pass control back to the default HttpHandler…
Jamie Treworgy
  • 23,934
  • 8
  • 76
  • 119
11
votes
4 answers

How to register HttpHandler for all subfolders in Asp.Net?

I would like to register an HttpHandler to include all subfolders of a root folder regardless of how far down they are nested. I would have expected the behavior with the below code to do just that but in fact it only includes items directly in the…
YonahW
  • 15,790
  • 8
  • 42
  • 46
11
votes
2 answers

Get file from POST request using Python's BaseHTTPServer

I'm running the code below to get POST messages. How do I get the file (sent with POST) and how do I respond with HTTP status code 200 OK? #!/usr/bin/env python import ssl import BaseHTTPServer, SimpleHTTPServer from BaseHTTPServer import…
Bob
  • 10,741
  • 27
  • 89
  • 143
11
votes
5 answers

Upload large files in .NET

I've done a good bit of research to find an upload component for .NET that I can use to upload large files, has a progress bar, and can resume the upload of large files. I've come across some components like AjaxUploader, SlickUpload, and…
Austin
  • 4,638
  • 7
  • 41
  • 60
11
votes
3 answers

Retrieve image from database in asp.net

How to retrieve images from sql database in asp.net using c#. i want to retrieve the image file from database and then display the image in a tag. i try this code but it is not working aspx
Ahmad Abbasi
  • 1,776
  • 6
  • 29
  • 43
11
votes
1 answer

Does an ASP.NET HttpHandler ever timeout

I have implemented an ASP.NET http handler. It appears to me that there is no way to set a timeout e.g. if the handler has been running for over X seconds dont serve the result. Am I correct here or is there a way to achieve a timeout for an ashx…
AJM
  • 32,054
  • 48
  • 155
  • 243
10
votes
3 answers

How do I get a request body from HttpServerExchange?

I created an Undertow server and a Handler to Log requests. I'm having problems to retrieve the request body of HttpServerExchange. At LoggingHandler class, I'm getting the body without problems. But at TestEndpoint the body is coming empty. If I…
FDB
  • 113
  • 1
  • 6
10
votes
1 answer

ISAPI vs httphandler

In IIS6 was there a reason for using ISAPI filters/ extensions?. Can the same not be achieved using httphandler/ http modules. Also in IIS7 has ISAPI been removed completely ?. Is the entire code of IIS7 written in .Net. I want to know should one…
Prashant
  • 2,190
  • 4
  • 33
  • 64
10
votes
1 answer

Building a HttpContext for testing, how can I specify the HttpRequest is a POST?

I'm writing some unit tests for a method that takes an HttpContext as a parameter. I want to test that the behavior is as expected when the request is a POST. When creating a System.Net.HttpWebRequest it's easy to set the method, but I can't see a…
mdchris
  • 103
  • 1
  • 4
9
votes
2 answers

HttpHandler to hook the *.svc requests

I'm trying to create a custom ASP.NET HttpHandler to work with any requests to a WCF web services (*.svc) to return a simple predefined SOAP message. However, after added the HttpHandler to the web.config as shown below. It seems that IIS doesn't…
SJ.
  • 113
  • 2
  • 7