Example of Simple HTTP GET request includes
GET /users/login.html HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Ubuntu; Linux x86_64;) Firefox/78.0
Accept: text/html, application/xhtml+xml,application/xml
Accept-Language: en-US, en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
Here in this example,
- GET/users/login.html is the request line which includes GET HTTP method.
- /users/login.html being the path of GET request to the resource on the server.
- Host: example.com is the header explaining the domain name of the web server where request is being sent.
Now heading back to the main topic, crafting a Netcat Command to Manually Make an HTTP GET Request with Netcat.
How to make an HTTP GET request manually with netcat?
Netcat,also known as “nc”, is a powerful Unix-networking utility that enables users to interact with network services through a command-line interface (CLI). It uses both TCP and UDP network protocols for communication and is designed to be a reliable back-end tool to instantly provide network connectivity to other applications and users. Although Netcat is more often known for its use in file transfers and port scanning, it can also act as an HTTP client and send and accept raw HTTP requests.