I am just trying some really basic Telnet as part of a HTTP tutorial, but everything I've read assumes that the Enter key works very differently than how it's been working for me so far.

So an example like:

Microsoft Telnet>o www.bing.com 80
Connecting To www.bing.com...
Microsoft Telnet>GET / HTTP/1.1 [ENTER]
Host: www.bing.com [ENTER]

Doesn't work at all for me because as soon as I press Enter key the first time, I immediately get

Invalid Command. type /?help for help

So I never even get the chance to complete the GET command.

I've tried having set crlf turned on and off, and that doesn't make a difference. Tried using Ctrl/Shift/Alt-Enter to get it to put in a newline instead of submitting the command, and no luck.

I've googled around a lot, and every tutorial / forum / etc. just assumes that the Enter key puts a LF or CRLF in and that you have to hit Enter twice to submit the command; I haven't found anything that addresses what to do if that is not the case.

I'm on Windows 7, with Telnet Client featured turned on, in a regular Command Prompt.

closed as off topic by Sven, mdpc, Dennis Kaarsemaker, dunxd, Wesley Apr 1 '13 at 1:05

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    It'll work fine if you do telnet <ip> <port> – gparent Mar 28 '13 at 18:24
  • @gparent No, that hasn't made any difference for me. – East of Nowhere Mar 28 '13 at 22:10
  • Weird, my bad. Usually works fine for me. Good luck! – gparent Mar 29 '13 at 3:50
  • Also: Apologies for the off topic question --- it looks like this would have been more appropriate for superuser.com than serverfault. My bad! – East of Nowhere Apr 1 '13 at 14:20
  • 1
    @east-of-nowhere From the C:\> command prompt type telnet www.bing.com 80 then enter, then press ctrl-], and you will see the Microsoft Telnet> prompt, and press enter again to get into echo mode. Now you can type in GET / HTTP/1.1 or multiple lines (get and headers). Press ctrl-enter when you have finished, or press enter on a blank line (that last feature means you can't enter a blank line - since telnet is not really designed for this purpose). To install telnet from a command line on Win-7 (as admin) from C:\> use pkgmgr /iu:"TelnetClient". – robocat Jul 12 '16 at 4:55

You were in command mode. Thus you were sending those commands to the telnet client, not to the open connection to the remote host.

To switch back to the open connection, press Enter (alone) at the telnet prompt. (And press Ctrl+] to switch back to command mode.)

  • That got some progress: pressing Enter like that does allow me to put in Microsoft Telnet>GET / HTTP/1.1 [ENTER] Host: www.bing.com [ENTER] and it must be sending the GET request after all because I'm getting a HTTP/1.0 400 Bad Request for every URL I try. I don't know if that's a problem with the telnet command I'm trying or if most web servers nowadays just reject telnet on principle, though... – East of Nowhere Mar 28 '13 at 21:06
  • 1
    Press Enter first, before you send the GET. – Michael Hampton Mar 28 '13 at 21:09
  • Still a Bad Request. But at least telnet is definitely sending something to the server! – East of Nowhere Mar 28 '13 at 21:15
  • Update - the Bad Request bit seemed to have something to do with me being behind a proxy at the time -- I tried all those steps on a different workstation later and finally got HTTP 200. – East of Nowhere Apr 1 '13 at 14:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.