Professional Documents
Culture Documents
(/)
HTTP Gallery
Jump to ...
2. HTTP Headers
Headers are name/value pairs that appear in both request and response messages. The name of the header is separated from the value by a
single colon. For example, this line in a request message:
UserAgent:Mozilla/5.0(WindowsNT6.3;WOW64;Trident/7.0;rv:11.0)likeGecko
provides a header called User-Agent whose value is Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1). The purpose of this particular
header is to supply the web server with information about the type of browser making the request. A complete denition of this and other
commonly encountered HTTP headers can be found in the HTTP 1.1 specication (http://www.w3.org/Protocols/rfc2616/rfc2616.html).
Some web applications use custom headers to add comments or annotations to an HTTP message. The convention is to prex the header name
with X- to indicate that it is non-standard. In the previous example, the HTTP response message from this web server set an X-AspNet-Version
header to indicate which version of ASP.NET it is running.
Example 2
Clicking the Get Current Time button requests an updated copy of the following image:
1. Open HttpWatch by right clicking on the web page and selecting HttpWatch from the context menu
The Headers tab will show two lists of headers; the one on the left is for the request message and the one on the right for the
response message.
Accept:*/*
https://www.httpwatch.com/httpgallery/headers/ 1/4
7/4/2017 HTTPHeaders|HttpWatch
This header indicates that the browser will accept all types of content.
AcceptLanguage:engb
AcceptEncoding:gzip,deflate
Connection:KeepAlive
Host:www.httpwatch.com
HTTP/1.1 requires that the host name is supplied with every request so that multiple domains can be hosted on a single IP address.
Referer:http://www.httpwatch.com/httpgallery/headers/
This is supplied by the browser to indicate if the current request was the result of a link from another web page. The server may use this
information to gather usage statistics or to track which web sites have links to a page.
UserAgent:Mozilla/5.0(WindowsNT6.3;WOW64;Trident/7.0;rv:11.0)likeGecko
This identies the browser is Internet Explorer Version 11 running on Windows 8.1 x64
CacheControl:nocache
This header indicates whether the resource may be cached by the browser or any immediate caches. The value no-cache disables all caching.
(See 5. Caching for more information (../caching/))
ContentLength:2748
This header contains the length in bytes of the resource (i.e. the gif image) that follows the headers.
ContentType:image/gif
Date:Wed,4Oct200412:00:00GMT
https://www.httpwatch.com/httpgallery/headers/ 2/4
7/4/2017 HTTPHeaders|HttpWatch
This is the current date and time on the web server.
Expires:1
The Expires header species when the content should be considered to be out of date. The value -1 indicates that the content expires
immediately and would have to be re-requested before being displayed again.
Pragma:nocache
The browser may be connecting to the server via HTTP/1.0 proxies or caches, that do not support the Cache-Control header. Setting Pragma to
no-cache header prevents HTTP/1.0 caches from storing the content.
Server:MicrosoftIIS/6.0
XAspNetVersion:4.0.30319
XPoweredBy:ASP.NET
(/DOWNLOAD/)
BUY NOW (/BUY/)
HttpWatch
Features (/features/httpdebugger.aspx)
Compare Editions (/editions.aspx)
New in Version 10.x (/newin10x.aspx)
Download (/download/)
Pricing (/buy/)
Our Customers
Who is using it? (/#customers)
What are they saying? (/#quotes)
Support
Technical Support (/support/)
About Us (/company/)
Contact Us (/company/)
Blog (http://blog.httpwatch.com)
Twitter (https://twitter.com/httpwatch)
Search (/search/) Terms & Conditions (/company/terms.aspx) Privacy Policy (/company/privacy_policy.aspx) Copyright (/company/copyright.aspx)
https://www.httpwatch.com/httpgallery/headers/ 4/4