IIS Home @ it-notebook.org

No HTTP headers when omitting HTTP version

(Kristofer Gafvert, February 18, 2011)


When working with raw HTTP, you may notice that sometimes no HTTP headers are returned. This depends on the GET header received from the client.

If you use WFetch and omit the protocol and version, IIS 7 will not respond with any headers, only the body. According to the HTTP RFC, you must specify the http protocol and version, unless the http version is 0.9 (also known as simple http). If you omit this (use simple http), IIS 7 will not respond with any headers. This is correct behavior according to the simple http specification.

It has been noted that this behavior differs between IIS 7 and IIS 6. IIS 6 will return the headers. But if we are strictly going by the specifications, IIS 7 is doing the right thing.

GET /\r\n

The above is simple http. In IIS 6, you will get the response including headers. In IIS 7 you will get no headers.

GET / HTTP/1.1\r\n

The above is HTTP 1.1. You will get the headers in both IIS 6 and IIS 7.

Applies to [?]

IIS 6.0, IIS 7.0, IIS 7.5


Simple HTTP (version 0.9)
RFC 1945 (informal), HTTP 1.0 (and some information about 0.9)
RFC 2616, HTTP 1.1