|
|
HTTP headersThe HTTP header tool shows you the headers returned by a typical HTTP request to a web server. UsageIn the text box, enter one of:
By default, the tool will send an HTTP request. If you want to send a secure HTTPS (SSL or TLS) request, check the "SSL" box. Specifying "https://" in the text box has no effect. Click the "HTTP Headers" radio button and then "Go." When to use itThis tool helps in diagnosing odd behavior in HTTP connections. It works only with a domain's default page; the path to a specific page will be ignored if you enter it. It shows you if the request will be redirected, so it can help you to optimize your links. What it doesThe HTTP header tool sends an HTTP GET request to the specified domain. It receives back a response, or else it times out if there isn't one. The response consists of an HTTP response code and other headers. Standard headers are defined by the World Wide Web consortium. A response may also include custom headers, whose names typically start with "X-". These are supposed to be just informational, and ignoring them shouldn't keep anything from working.
At the top you'll see
The status codeThe output will have a line of the form "HTTP headers for [your.domain]." It's followed by a line containing the HTTP version and status code. The status code is the most important piece of information. The full list of codes is long, but here are some of the common ones:
Interesting headers
The Content-Type header indicates the format of the data being returned.
For example, an HTML page might have this:
The Content-Encoding header says how the data is encoded. Data is
often sent in a compressed format for efficiency. An example:
The Last-Modified header tells you when the content last changed.
For static pages it will normally be the file's modification date.
For dynamically generated pages the way of computing the date may
vary. It's never supposed to give a future date. An example:
The Set-Cookie header does just what it says. There can be more than
one in a response. The simplest case looks like this:
The Cache-Control header gives cache directives to the browser.
If the content is never supposed to be cached, you might see
The Allow header tells you what HTTP methods are accepted. Example:
A deeper lookWhen you enter a URL in a browser, the server often redirects it one or more times and gives you the result of a different URL. It may also instruct the browser to use cached information. HTTP status codes in the 300s produce these results. The HTTP headers tool shows you the status code which the server sent back and the new destination, rather than doing the redirection. If you enter just a domain name in a browser's address bar, you'll often be redirected to the www subdomain (example.com to www.example.com). With this tool, you'll see the redirection response. It will usually have a 301 status code but could have something else in the 300 range. You may get back a 301 redirection to the equivalent https URL (e.g., http://example.com to https://example.com). This helps people to get to a secure page, but it's not something to count on. Change the link if you can. The response to your own browser might be different for several reasons. The server may send different responses depending on the client IP address or the HTTP headers in the request. The server may use Accept, Accept-Language, User-Agent, and other headers to redirect you to a different page. Interesting stuffA rare but grimly amusing status code is 451, "Unavailable for legal reasons." The code was named after Ray Bradbury's novel about book-burning, Fahrenheit 451. |