cURL is the most widely used command on the terminal/console to test an HTTP GET request payload. It is very simple to use and comes pre-installed on Windows Command Line and macOS Terminal.
cURL HTTP GET request Syntax:
curl THE-HTTP-GET-URL
Example:
curl http://code2care.org/testing-http-get-with-curl-command
Example on Windows Command Prompt
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>This page was viewed using cURL command</title>
</head>
<body>
<h1>Hello World! cUrl Http Get</h1>
</body>
</html>
Example macOS or Linux Terminal:
$ curl google.com
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 219 100 219 0 0 2009 0 --:--:-- --:--:-- --:--:-- 2009
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>
As you can see in the examples this is the simplest cURL command to fetch the content of an HTTP URL, it will print out the whole HTML source code of the URL in the console as output.
cURL HTTP GET request with Response Headers:
If you are interested in knowing the HTTP response headers as well you can make use of argument -i (include) to print it, as you can see below the headers are printed before the HTML payload.
$ curl -i google.com
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 219 100 219 0 0 1063 0 --:--:-- --:--:-- --:--:-- 1068
HTTP/1.1 301 Moved Permanently
Location: http://www.google.com/
Content-Type: text/html; charset=UTF-8
Date: Sat, 01 Aug 2020 11:43:19 GMT
Expires: Mon, 31 Aug 2020 11:43:19 GMT
Cache-Control: public, max-age=2592000
Server: gws
Content-Length: 219
X-XSS-Protection: 0
X-Frame-Options: SAMEORIGIN
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>

Have Questions? Post them here!
- Fix NVIDIA GeForce Experience ERROR CODE 0x0003
- How to convert byte array to String [Kotlin]
- Unzip a Zip file from Terminal Command
- How to write hello world different languages syntax
- [Error] zsh: command not found: mvn
- How to know the version of OpenSSL
- [Solution] IDEA IntelliJ System.out.println function shortcut (sysout alternative for eclipse IDE)
- The default username and password for RabbitMQ
- ChatGPT Outage: Hmm...something seems to have gone wrong. Maybe try me again in a little bit.
- How to check the version of NodeJS installed
- Gmail Unable to upload because it is a folder or a package (like an application bundle or RTFD document)
- How to remove password from pdf file
- BSNL Broadband upgrades speed to minimum 2MBps for all users 512Kbps 1Mbps
- MongoDB: Failed to connect to 127.0.0.1:27017 reason: Connection refused
- Turn off Focus Mode on Mac
- Steps to Delete or Deactivate Instagram Account
- [IRCTC] Indian railways official eRail API 1.1 for developers to get train info
- CentOS Cannot find a valid baseurl for repo base7x86_64 yum
- Why I see Download pre-built shared indexes in IntelliJ
- Copy file from a remote server to current local directory system using SCP command
- [Fix] Minecraft Error: A JNI error has occurred, please check your installation and try again
- How to install Zsh shell
- Merge multiple zip files without unzipping (extracting)
- How to find someone on Instagram
- How to get an embed code from Vimeo?
- 5 ways to pop out a Chat in Microsoft Teams - Teams
- Customizing Notepad++ New Document Line Encoding: CR/LF/CR LF - NotepadPlusPlus
- Microsoft Teams change default language - Teams
- How to install XML Tools Plugin Notepad++ - NotepadPlusPlus
- Facebook Thanks for stopping by! We hope to see you again soon. - Facebook
- How to change the System Settings Sidebar icon size Mac Ventura 13 - MacOS
- Change Max and Min Value of Android Seekbar Programmatically - Android
- Eclipse : The type java.lang.CharSequence cannot be resolved. Indirectly referenced from required .class files - Java