Ask Your Question

How can I do a simple HTTP get request with Telnet?

asked 2023-04-23 11:47:17 +0000

qstack gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2023-04-23 11:49:04 +0000

qstack gravatar image

Here's a step-by-step guide on how to perform an HTTP GET request using Telnet:

Open a terminal or command prompt on your computer. Type telnet 80 and press Enter. Replace with the domain you want to connect to and 80 with the port number (80 is the default port for HTTP). If the connection is successful, you'll see a blank screen or a prompt like "Connected to" Now you need to type the HTTP GET request manually. Here's a basic request:

GET /path/to/resource HTTP/1.1
Connection: close

Replace /path/to/resourcewith the actual path of the resource you want to request, and with the domain you're connecting to.

Note that each line ends with a carriage return and a line feed (CRLF, represented as \r\n). In most terminals, you can simply press Enter to send a CRLF.

After typing the request, press Enter twice to send a blank line, signaling the end of the request headers. The server should now send the HTTP response, which will be displayed in your terminal. The response will include the status line, headers, and the requested resource's content (if available). Once the response is complete, the connection will close, and you'll be returned to the command prompt.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer

Question Tools

1 follower


Asked: 2023-04-23 11:47:17 +0000

Seen: 3 times

Last updated: Apr 23