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 example.com 80
and press Enter
. Replace example.com 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 example.com." Now you need to type the HTTP GET request manually. Here's a basic request:
GET /path/to/resource HTTP/1.1
Host: example.com
Connection: close
Replace /path/to/resource
with the actual path of the resource you want to request, and example.com 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.
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
Asked: 2023-04-23 11:47:17 +0000
Seen: 14 times
Last updated: Apr 23
How can I print all but the first 1000 Lines from a File in Bash?
Bash Script that checks if a Host is available or not?
How can I check the expiry of a SSL certificate in the Command Line?
How can I only get the Column with the Filename from a ls -all output with Awk?
What is the Difference of "source script.sh" and "./script.sh" in Bash?
How can I fix error: Security violation, ping RPC from uid 1001 in Slurm log?
I want to grep for "```*" in a File, in other Words: "```" followed by any Word
Sed: I want to remove a Word after all ``` in the given File