How can i modify one item of Request.Header ? RRS feed

  • Question

  • User750184344 posted

    Hi Friends,

    I want to modify one value of Reqest.Header(5). How can i ? It is not allowing me to modify as like it is read only.

    I am trying Request.Header(5) = "New Value", I also tried Request.Headers.Add("N","New Value")

    Can you give me a sample code to Add or Modify Request.Headers ?


    Nirav Parekh


    Tuesday, May 30, 2006 1:07 PM

All replies

  • User-1639143169 posted

    I suggest you have a look at this thread: http://forums.asp.net/thread/1250479.aspx

    The modifying the header needs to be done before the request processing so you need a module or something likee that.


    Tuesday, May 30, 2006 2:24 PM
  • User750184344 posted


    Ya. I am doing this in a class that implements iHTTPModule.

    I am doing this in its BeginRequest Event.

    Thanks for this code. Now I am able to adding headers using this code.

    But can you tell me where can I view all Request.Headers ? I mean now it is adding header but where can i see the values and keys of this headers ? I mean exacpt debugging.

    Also, please tell me how should i modify exising headers ?



    Tuesday, May 30, 2006 2:36 PM
  • User-1639143169 posted

    If you enable trace, and view trace output... you shoudl see all you request headers there.


    Tuesday, May 30, 2006 3:14 PM