Use Telnet to view the response message returned by the HTTP server

Step 1: Open the CMD run box, enter Telnet www.baidu.com 80 and press the Enter key (the screen is black at this time), and then use the shortcut key "Ctrl+]" to open the Telnet echo (Telnet does not echo by default) .


Part 2: After pressing the Enter key (note that it is pressed in the above state), enter the editing state

as the picture shows:


third step:

Enter: " GET / HTTP/1.1" and then press Enter (note the space when entering), press the Enter key, then enter Host:www.baidu.com, and press the Enter key twice in a row (two Enters represent the submission of the request ). The input speed must be fast, otherwise the connection will fail, or the code will be written into Notepad, which can be copied directly when using it.

      Some people already have this function on their computer, but they can skip to 5

  1. Press Windows+R on the keyboard to open the Run window.

    How to copy and paste commands in a DOS window?
  2. Enter cmd at "Open" and press enter to open a DOS window.

    How to copy and paste commands in a DOS window?
  3. Move the mouse to the title of the DOS window, right-click, and select Properties.

    How to copy and paste commands in a DOS window?
  4. Check the "Quick Edit Mode" in the Editing Options and click the OK button.

    How to copy and paste commands in a DOS window?
  5. After selecting the command with the left mouse button, click the right mouse button to complete the copying of the command.

    How to copy and paste commands in a DOS window?
  6. Click the right mouse button again at the pasting place to complete the pasting of the command.

    How to copy and paste commands in a DOS window?



the fourth step:

Receive the server return, this step does not actually need us to do, because when we send the request, it only takes a few seconds, we will receive the response from the server.


This is a Baidu visit by hand.



Reprinted from: https://blog.csdn.net/rain722/article/details/53047116

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324638737&siteId=291194637