[cs631apue] HTTP 0.9 requests

Jan Schaumann jschauma at stevens.edu
Mon Nov 25 12:44:23 EST 2013


yluo4 <yluo4 at stevens.edu> wrote:
>   Does HTTP/0.9 have simple request?

An HTTP/0.9 simple request looks like this:

GET /

Here, you'd immediately return the document in question.  You can try
this out against www.apache.org, for example:

echo "GET /" | nc www.apache.org 80 | head
echo "GET /doesnt-exist" | nc www.apache.org 80 | head

If a client sends

GET / HTTP/0.9

then you can treat it as a full request and respond as if to a valid
HTTP/1.0 request.  Apache again seems to handle that correctly:

( echo "GET / HTTP/0.9"; echo; ) | nc www.apache.org 80 | head
( echo "GET /doesnt-exist HTTP/0.9"; echo; ) | nc www.apache.org 80 | head

Hope this answers your question.

-Jan


More information about the cs631apue mailing list