I am trying to add a custom Headers -> e1 HttpContext.Current.Response.AddHeader("e1","example of an exception"); to HTTP response in Page_Load method which works fine as I checked it in chrome developer tools.

The problem is if I am trying to write the same response using : HttpContext.Current.Response.Write(HttpContext.Current.Response.Headers["ALL_HTTP"].ToString());
it causes an PlatformNotSupportedException : This operation requires IIS integrated pipeline mode.
So the main question is how to read the added response header given I am using the inbuilt VS development server?
And it would be great if you can suggest some articles or book to know about properly using HTTP headers and verbs.
If you want to write that variable directly to the response then you can simply call this in your Page_Load. This will avoid the IIS integrated pipeline mode requirement.
Page.Response.Write(Request.ServerVariables["ALL_HTTP"]);
For learning I would concentrate on learning about HTTP and REST.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With