Making Web Requests with NetCat
Learn how to make web requests using NetCat.
We'll cover the following
Using netcat
We already used curl
to grab web pages, but netcat
can do that too. However, netcat
makes us do it a little more interactively.
First, run this command:
$ nc www.google.com 80
A blank line greets us because netcat
is expecting some input. We’re going to craft our own HTTP request by hand. We type the following two lines:
GET / HTTP/1.1
HOST: google.com
Then, we press the “Enter” key once more to send a blank line, and we see the response from the server, including the headers and source code for the Google home page stream out to the screen.
Get hands-on with 1400+ tech skills courses.