What is HTTP Header?


A header is a series of lines, with each line containing a name followed by a colon and a space, and then a value. HTTP headers expose a great deal of information about your client as well as the server. Some header fields are used in both request and response headers, while others are only for either a request or a response.

Following C# code can be used to view all Server Variables:


foreach (string var in Request.ServerVariables)
{
Response.Write(var + " " + Request[var] + "<br>");
}

If you want to view all the server variable on your site, just copy paste above code into your code behind page. Make sure to try this with different browsers and on different computers with different operating systems, if you can. You’ll immediately see the differences. You will get a list of all the HTTP headers along with the actual value for the header.

Here is the output in my project:

MSDN HTTP Headers Reference Link

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s