Subject: Confused by HTTP 1.0 vs HTTP 1.1

From: Matthew Stanfield <[email-masked]>
Date: Tue, 04 Mar 2003 18:51:23 +0000

Hi,

Firstly I am not entirely sure this is the correct place to post but
judging the kind of questions in this mailing list's archives it seems
appropriate.

I've developing some software that uses sockets to communicate with web
servers using HTTP. I've seen both HTTP/1.0 and HTTP/1.1 used in GET
headers. EG. "GET / HTTP/1.0" and "GET / HTTP/1.1". So far I've been using
HTTP 1.0 in my GET headers but while browsing this list's archives I saw
that HTTP 1.1 is in use (EG. the thread "HTTP 1.1, proxy servers, and
failed connections") and wondered whether I should in fact be using 1.1
instead.

Having run some tests it seems that some 'mainstream' web servers (EG.
www.google.com) don't seem to respond to a HTTP 1.1 GETs. While others (EG.
www.yahoo.com) do and act normally.

Can someone explain to me whether I should be using HTTP 1.1 at all and, if
so, under what circumstances?

Apologies if this is off-topic, trivial or documented in a resource that I
should have read before posting but obviously didn't find.

Thanks and regards,

..matthew

---

From: Peter Watkins <[email-masked]>
Date: Tue, 4 Mar 2003 14:22:59 -0500

> www.yahoo.com) do and act normally.

It sounds like you've been sending a minimal HTTP/1.0 request to these
servers, and tried simply changing the HTTP/1.0 to HTTP/1.1 in the initial
request line. HTTP 1.1 also requires requests to provide a Host header.
Read the RFC for details, but I think you'll find that most servers accept
properly-formatted HTTP 1.0 or HTTP 1.1 requests -- probably HTTP 0.9,
also, but let's not go there. ;-)

-- 
Peter Watkins - [email-masked] - [email-masked] - http://www.tux.org/~peterw/ 
Private personal mail: use PGP key F4F397A8; more sensitive data? Use 2D123692

---

From: Scott Lawrence <[email-masked]>
Date: 04 Mar 2003 14:29:54 -0500

> failed connections") and wondered whether I should in fact be using 1.1

Probably.
 
> www.yahoo.com) do and act normally.

Google does use HTTP/1.1 (though in checking that, I discovered that
thier server does not support either OPTIONS or TRACE).  If they are
not responding as you expect, then you are probably not constructing
the request correctly; there are differences.  See RFC 2616:

  ftp://ftp.isi.edu/in-notes/rfc2616.txt

(most likely you are not including a 'Host' header - it was not
required in 1.0, but is in 1.1).
 
> so, under what circumstances?

It has far better control of caching, and properly supports persistent
connections; if either would be useful, then certainly.

-- 
Scott Lawrence        
  Actively seeking work 
  http://world.std.com/~lawrence/
  [ <[email-masked]> is deprecated ]

---

From: Matthew Stanfield <[email-masked]>
Date: Wed, 05 Mar 2003 18:26:16 +0000

> required in 1.0, but is in 1.1).

Many thanks Peter and Scott. You are absolutely correct, I was under the
impression that you just needed to replace the HTTP/1.0 with 1.1 in my GET
headers. Sorry if my question was trivial for the list. Thanks for not
telling me to RTFM.

Regards,

..matthew