This section provides a tutorial example on how to test and view HTTP response header lines returned by IIS on 3 types of static files: HTML document, GIF image file, and PDF document.
Since I am using IIS (Internet Information Service) as the Web server,
static files will be served directly by IIS server. It will set the status line and
header lines for you based on the information collected from the static file the HTTP request is asking.
For example, the "Content-Type" header line will be set based on the file name extension
and the MIME settings of the server configuration. The "Content-Length" header
line will be set to the size of the file.
Let's look at 3 examples of different types of static files. All of them are stored on my local machine at c:\inetpub\wwwroot,
where the IIS is serving documents from.
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.1
Date: Sun, 13 Nov 2005 04:40:17 GMT
Content-Type: image/gif
Accept-Ranges: bytes
Last-Modified: Sun, 11 Aug 2002 20:48:20 GMT
ETag: "04237ecd343c21:c61"
Content-Length: 43
GIF89a......
As you can see, Content-Type was set correctly to "image/gif" for file name extension
"gif", as defined in the MIME settings. I could not include the entire entity body here because it contains binary data.
Again, Content-Type was set correctly to "application/pdf" for file name extension
"pdf", as defined in the MIME settings. I truncated the entity body to save some space.