For logging purposes i want to read all HTTP-Headers which are sent to the client anywhere in my application in order to log them to the database. However the Location-header is always missing on redirects. maybe there are even more missing that i will never know about. How can i get all headers?
Share
There are a lot of issues surrounding accessing the Headers collection of an HttpResponse object. Basically you need to be running IIS7 in “integrated pipeline mode”. If you can do this, you could simply take a look at the Response.Headers collection at the appropriate time. Try something like this in your Global.asax file:
If you’re not running IIS7… then you might be out of luck for an easy code solution.