making get requests to server

 
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions
View previous topic :: View next topic  
Author Message
whackaxe
Guest





PostPosted: Sun Oct 20, 2002 5:04 pm    Post subject: making get requests to server Reply with quote

i have a question about making http requests. i would like to open a connection to my server and save it to a file in telnet. so what i do is this

i open the connection on 127.0.0.1 on port 80 using telnet whilst logging it.
the i have a prompt and i type

GET index.php HTTP/1.1

and then hi enter twice and get a bad request message.

is that command correct and if not could someone tell me what it would be, i just want tobe able to connect to any page using telnet and hve it logged. cheers
Back to top
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sun Oct 20, 2002 9:13 pm    Post subject: Re: making get requests to server Reply with quote

whackaxe wrote:
i have a question about making http requests. i would like to open a connection to my server and save it to a file in telnet. so what i do is this

i open the connection on 127.0.0.1 on port 80 using telnet whilst logging it.
the i have a prompt and i type

GET index.php HTTP/1.1

and then hi enter twice and get a bad request message.

is that command correct and if not could someone tell me what it would be, i just want tobe able to connect to any page using telnet and hve it logged. cheers

Try
Code:

GET /index.php HTTP/1.1

All the URLs must begin with / after a GET.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Guest






PostPosted: Mon Oct 21, 2002 6:02 pm    Post subject: Reply with quote

thanks! does anyone know where i could learn more about this stuff?
Back to top
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Mon Oct 21, 2002 6:56 pm    Post subject: Reply with quote

Anonymous wrote:
thanks! does anyone know where i could learn more about this stuff?

The REFERENCE of HTTP is at http://www.w3.org/Protocols/rfc2616/rfc2616.html . This is a long long document but it contains everything about that protocol.
There are also a lot of interesting links on HTTP (especially tutorials if you want to learn quickly how it works) at http://www.webopedia.com/TERM/H/HTTP.html .
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Kyle
Guest





PostPosted: Wed Oct 30, 2002 8:55 pm    Post subject: Similar problem...I think Reply with quote

I'm trying to get a txt file from telnet, but when I type GET /filename.txt http/1.0 (or 1.1), I get a 400 error. Do I need additional headers?


Kyle
Back to top
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Wed Oct 30, 2002 9:19 pm    Post subject: Re: Similar problem...I think Reply with quote

Kyle wrote:
I'm trying to get a txt file from telnet, but when I type GET /filename.txt http/1.0 (or 1.1), I get a 400 error. Do I need additional headers?


Kyle

With HTTP/1.0, you can type:
Code:

GET /filename.txt HTTP/1.0


Error 400 occurs because you type http/1.0 not HTTP/1.0.

HTTP/1.1 is more complex. To have the same result, you must type the following:
Code:

GET /filename.txt HTTP/1.1
Host: hostname
Connection: Close


Change hostname with your host's name (you can use for example 127.0.0.1) and the Connection header must be added in order to be fully conforming to standards.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
kyle
Guest





PostPosted: Wed Oct 30, 2002 9:22 pm    Post subject: Could I have been more confusing? Reply with quote

Sorry, that was a bit confusing. I am telnetting in to my server on port 80. I want to get a text file that is in my htdocs folder. I type GET /filename.txt http/1.1 and I get a 400 error.

hmm, I just tried to get my index.html in the same manner and got the same error....what am I doing wrong?


Thanks for any help you can give.
Kyle
Back to top
Kyle
Guest





PostPosted: Wed Oct 30, 2002 9:25 pm    Post subject: Wow Reply with quote

While I was clarifying, you were fixing. Thank you very much.


Kyle
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group