View previous topic :: View next topic |
Author |
Message |
whackaxe Guest
|
Posted: Sun Oct 20, 2002 5:04 pm Post subject: making get requests to server |
|
|
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
|
Posted: Sun Oct 20, 2002 9:13 pm Post subject: Re: making get requests to server |
|
|
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 |
|
|
Guest
|
Posted: Mon Oct 21, 2002 6:02 pm Post subject: |
|
|
thanks! does anyone know where i could learn more about this stuff? |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
|
Back to top |
|
|
Kyle Guest
|
Posted: Wed Oct 30, 2002 8:55 pm Post subject: Similar problem...I think |
|
|
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
|
Posted: Wed Oct 30, 2002 9:19 pm Post subject: Re: Similar problem...I think |
|
|
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 |
|
|
kyle Guest
|
Posted: Wed Oct 30, 2002 9:22 pm Post subject: Could I have been more confusing? |
|
|
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
|
Posted: Wed Oct 30, 2002 9:25 pm Post subject: Wow |
|
|
While I was clarifying, you were fixing. Thank you very much.
Kyle |
|
Back to top |
|
|
|