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:38:05 UTC

[users@httpd] Problems with "GET" method

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 www.msn.com 80
Trying 207.68.172.234
Connected to www.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 "GET" method

Posted by "Eric L. Johnson" <es...@cfl.rr.com>.
Thank you very much for all of your assistance Eugene!!!! I am sure that
that will solve the problem!!!!

Best Regards,
Eric.

----- Original Message -----
From: "Eugene Lee" <li...@fsck.net>
To: <us...@httpd.apache.org>
Sent: Wednesday, June 09, 2004 5:11 PM
Subject: Re: [users@httpd] Problems with "GET" method


> On Wed, Jun 09, 2004 at 04:38:05PM -0400, Eric L. Johnson wrote:
> :
> : For example, if I perform the following to MSN's website, I obtain the
> : following:
> :
> : telnet www.msn.com 80
> : Trying 207.68.172.234
> : Connected to www.msn.com
> : Escape Character is '^]'
> :
> : GET / HTTP/1.0
> :
> : The results come out as follows:
> [...okay results...]
> :
> : 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)
> [...not okay results...]
>
> : 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.
>
> HTTP/1.1 requires a Host: header.  Try this instead:
>
> telnet www.msn.com 80
> Trying 207.68.172.234
> Connected to www.msn.com
> Escape Character is '^]'
>
> GET / HTTP/1.1
> Host: www.msn.com
>
>
> --
> Eugene Lee
>
> ---------------------------------------------------------------------
> 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 "GET" method

Posted by Eugene Lee <li...@fsck.net>.
On Wed, Jun 09, 2004 at 04:38:05PM -0400, Eric L. Johnson wrote:
: 
: For example, if I perform the following to MSN's website, I obtain the
: following:
: 
: telnet www.msn.com 80
: Trying 207.68.172.234
: Connected to www.msn.com
: Escape Character is '^]'
: 
: GET / HTTP/1.0
: 
: The results come out as follows:
[...okay results...]
: 
: 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)
[...not okay results...]

: 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.

HTTP/1.1 requires a Host: header.  Try this instead:

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

	GET / HTTP/1.1
	Host: www.msn.com


-- 
Eugene Lee

---------------------------------------------------------------------
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