using Response.Headers within HttpHandler

  • Thread starter Thread starter deerchao
  • Start date Start date
D

deerchao

I'm writing my IHttpHandler, but whenever I call members of
"HttpContext.Current.Response.Headers", I got an
PlatformNotSupportedException says "This operation requires IIS
integrated pipeline mode.".
Is there no way to use HTTP headers in custom HttpHandlers?
Thanks!
 
You are not supposed to use the HttpContext returned by Current in the
IHttpHandler implementation. Rather, you should use the HttpResponse
returned to you through the HttpContext passed in through the context
parameter of the ProcessRequest method implementation.
 
Back
Top