I’d like to email myself a quick dump of a GET request’s headers for debugging. I used to be able to do this in classic ASP simply with the Request object, but Request.ToString() doesn’t work. And the following code returned an empty string:
using (StreamReader reader = new StreamReader(Request.InputStream))
{
string requestHeaders = reader.ReadToEnd();
// ...
// send requestHeaders here
}
Have a look at the Headers property in the Request object.
C#
Or, if you want it formatted in some other way:
VB.NET:
Or: