trying to understand http and headers i was playing around with telnet to send requests. to not type everything again and again and again i thought i'd write a small textfile with all the commands i need.
my file is as simple as follows:
GET /somefile.php HTTP/1.1
Host: localhost
i then try to feed it to telnet with io-redirection:
$ telnet localhost 80 < telnet.txt
but all output i get is
Trying ::1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.
what am i doing wrong?
To log on to an Internet server and look at information there, you use the telnet protocol. For example, you use telnet to log on to the library's server. You cannot download or upload files using telnet. To download or upload files, you use the File Transfer Protocol (FTP).
telnet is not the right tool for this job. Try :
netcat localhost 80 < telnet.txt
btw, if you don't have the tool installed on your machine, you can get it here:
http://netcat.sourceforge.net/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With