How to send a GET request using cURL
A GET request is the most common way to ask a server for a resource.
With curl, you rarely need to name the method at all: the command treats GET as its default. This guide shows the minimal command, a real HTTPBin response, and the one situation where adding -X GET makes your intent clearer.
The minimal GET request
Pass the URL directly to curl. Because GET is the default HTTP method, curl sends a GET request without any extra flag. The command below targets an HTTPBin endpoint that echoes back details about the request it received.
What the response looks like
curl prints the response body to the terminal. HTTPBin returns JSON describing the request: its arguments, headers, method, origin IP, and the URL that was called. The excerpt below shows the fields that matter most for confirming a GET request.
Adding -X GET explicitly
You can state the method with -X GET. The result is the same GET request, but the flag makes the method visible in the command itself. In most cases it is unnecessary because curl already defaults to GET when no other method is specified.
When to omit -X GET and when to keep it
Use this checklist to decide whether the explicit flag earns its place in your command:
- Omit -X GET when the command is a simple fetch and readability matters. curl already sends GET.
- Keep -X GET when the command is part of documentation or a script where the method should be obvious at a glance.
- Keep -X GET when you are comparing several curl commands side by side and want the method to stand out.
- Do not add -X GET expecting it to change behavior; it only names the method curl would use anyway.
Reading the HTTPBin response fields
The JSON response is a mirror of your request. These fields are the most useful for verification:
- method: shows GET when curl used the default method.
- url: echoes the endpoint you called, including the query string.
- headers: lists the request headers curl sent, such as Accept and User-Agent.
- args: shows query parameters parsed from the URL.
- origin: the IP address HTTPBin saw for the request.
If method reads GET, the request was sent as a GET. The other fields help you confirm the URL and headers were what you intended.
Frequently asked questions
Does curl send a GET request by default?
Yes. When no other method is specified, curl uses GET. You only need to name the method if you want it visible in the command or if you are switching to a different method.
What is the difference between curl URL and curl -X GET URL?
Both send a GET request. The -X GET form states the method explicitly, which can help readability in scripts and documentation, but it does not change the request itself.
How can I confirm that curl sent a GET request?
Use an echo endpoint such as HTTPBin. Its JSON response includes a method field. If that field reads GET, the request was sent as a GET.
curl "{{HTTPBIN_BASE_URL}}/anything?json"
{
"args": {
"json": ""
},
"data": "",
"files": {},
"form": {},
"headers": {
"Accept": "*/*",
"Host": "httpbin.scrapingbee.com",
"L5D-Dst-Override": "scrapingbee-httpbin.httpbin.svc.cluster.local:80",
"User-Agent": "curl/8.5.0"
},
"json": null,
"method": "GET",
"origin": "105.164.128.44",
"url": "{{HTTPBIN_BASE_URL}}/anything?json"
}
"json": null,
"method": "GET",
"origin": "105.164.128.44",
"url": "{{HTTPBIN_BASE_URL}}/anything?json"
curl -X GET "{{HTTPBIN_BASE_URL}}/anything?json"
{
"args": {
"json": ""
},
"data": "",
"files": {},
"form": {},
"headers": {
"Accept": "*/*",
"Host": "httpbin.scrapingbee.com",
"L5D-Dst-Override": "scrapingbee-httpbin.httpbin.svc.cluster.local:80",
"User-Agent": "curl/8.5.0"
},
"json": null,
"method": "GET",
"origin": "105.164.128.44",
"url": "{{HTTPBIN_BASE_URL}}/anything?json"
}