You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Eric L. Johnson" <es...@cfl.rr.com> on 2004/06/09 22:47:22 UTC

[users@httpd] problems with request line for the apache server

I am currently running Linux 7.2 with Apache version 2.0.49.  I am currently having intermittent problems with the "GET" method while running the Apache server.  I have read the RFC 2616 Section 5 and it states to put the request in the form of the following:

Request-Line = Method SP Request-URI SP HTTP-Version CRLF

For example, if I perform the following to MSN's website, I obtain the following:

telnet msn.com 80
Trying 207.68.172.234...
Connected to msn.com
Escape Character is '^]'

GET / HTTP/1.0

The results come out as follows:

HTTP/1.1 200 OK (which is the desired result)
.
.
.
(followed by the correct HTML for the MSN home page)
.
.
Connection Closed by Foreign Host.

However, if I telnet to the MSN site and perform the following:

GET / HTTP/1.1

The results come out as follows:

HTTP/1.1 400 Bad Request (which is not the desired result)
.
.
.
(followed by the incorrect HTML for the MSN home page)
.
Connection Closed by Foreign Host.

Why do I sometimes have to use "GET / HTTP/1.0 vs. GET / HTTP/1.1" to obtain the desired results on some web pages and not on others.  I have even varied the format of the request line to look the like the following: "GET / HTTP-1.1" or "GET / HTTP 1.1" which has afforded me more consistent results on some web sites, whereas I perform the GET request utilizing HTTP 1.1 and I obtain the proper reply back from the remote host.   Is there a format for the request line that would be consistent with the specification and yield consistent results?  Any assistance that you can afford would be greatly appreciated!! Thank you very much!

Eric.


Re: [users@httpd] problems with request line for the apache server

Posted by "Eric L. Johnson" <es...@cfl.rr.com>.
Thank you very much Joshua!!!!  That fixes my problem!

Eric.

----- Original Message -----
From: "Joshua Slive" <jo...@slive.ca>
To: <us...@httpd.apache.org>
Sent: Wednesday, June 09, 2004 4:58 PM
Subject: Re: [users@httpd] problems with request line for the apache server


>
> On Wed, 9 Jun 2004, Eric L. Johnson wrote:
>
> > However, if I telnet to the MSN site and perform the following:
> >
> > GET / HTTP/1.1
> >
> > The results come out as follows:
> >
> > HTTP/1.1 400 Bad Request (which is not the desired result)
> > .
>
> > Why do I sometimes have to use "GET / HTTP/1.0 vs. GET / HTTP/1.1" to
> > obtain the desired results on some web pages and not on others.
>
> If you read a little farther in the HTTP spec, you'll see that the Host:
> header is *required* by HTTP/1.1, and servers MUST reject requests that
> don't have it.  On the other hand, the Host: header is optional in
> HTTP/1.0.  If you found server that accept an HTTP/1.1 request without the
> Host: header, then they are not really HTTP/1.1 servers.
>
> > I have
> > even varied the format of the request line to look the like the
> > following: "GET / HTTP-1.1" or "GET / HTTP 1.1" which has afforded me
> > more consistent results on some web sites,
>
> Since neither of these are valid HTTP version strings, the server is being
> kind to you and assuming you meant to say HTTP/1.0.
>
> Your requests should look like this:
> telnet www.example.com 80
> GET / HTTP/1.1
> Host: www.example.com
>
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] problems with request line for the apache server

Posted by Joshua Slive <jo...@slive.ca>.
On Wed, 9 Jun 2004, Eric L. Johnson wrote:

> However, if I telnet to the MSN site and perform the following:
>
> GET / HTTP/1.1
>
> The results come out as follows:
>
> HTTP/1.1 400 Bad Request (which is not the desired result)
> .

> Why do I sometimes have to use "GET / HTTP/1.0 vs. GET / HTTP/1.1" to 
> obtain the desired results on some web pages and not on others.

If you read a little farther in the HTTP spec, you'll see that the Host: 
header is *required* by HTTP/1.1, and servers MUST reject requests that 
don't have it.  On the other hand, the Host: header is optional in 
HTTP/1.0.  If you found server that accept an HTTP/1.1 request without the 
Host: header, then they are not really HTTP/1.1 servers.

> I have 
> even varied the format of the request line to look the like the 
> following: "GET / HTTP-1.1" or "GET / HTTP 1.1" which has afforded me 
> more consistent results on some web sites,

Since neither of these are valid HTTP version strings, the server is being 
kind to you and assuming you meant to say HTTP/1.0.

Your requests should look like this:
telnet www.example.com 80
GET / HTTP/1.1
Host: www.example.com

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org