logo anonymous proxies logo anonymous proxies
path

How to Use cURL to Send GET Requests: Quick Tutorial

You can think of cURL as your command line remote for the web. It is everywhere and will let you get pages, JSON, or images while setting headers, cookies, and sessions. Because curl fits nicely into scripts, it is a great tool for quick checks and simple automation. This guide will focus exclusively on GET requests, starting simply and layering in the essentials until your quick one-liners become reliable workflows.

Products referenced in this article

HTTP Proxies

HTTP Proxies are handling HTTP requests towards the internet on behalf of a client. They are fast and very popular when it comes to any kind of anonymous web browsing.

SOCKSv5

SOCKSv5 is an internet protocol that is more versatile than a regular HTTP proxy since it can run on any port and traffic can flow both on TCP and UDP. Useful in games and other applications that do not use the http protocol.

What Is a GET Request?

A GET request is the most basic way a client retrieves information from a server. A GET will fetch a representation of a resource without causing any changes to the server, making it safe for reading lists of products, confirming health endpoints, or loading public pages. GET is an idempotent method, so sending the same request in succession should return the same result, except for circumstances involving modifications to the data by a third party.

Of course, GET is only one option. When you need to send or modify data, you will reach for POST, and many APIs use PUT, PATCH, or DELETE for updates and removals. Think of GET as reading, while the others are for writing and editing.

Below is a very basic example of a GET request with cURL.

curl https://www.anonymous-proxies.net/

After running the GET request, the server should reply with the HTML content for the public landing page. In a terminal, you will see standard markup that a browser would render, including the page structure, navigation links, and content sections describing proxy services and calls to action.

Executing a Basic GET Request with cURL

cURL is available on most Unix like systems and easy to install on Windows, which makes it a handy, zero fuss way to test endpoints. When you provide only a URL, cURL performs a GET and streams the response to your terminal so you can see exactly what the server returns in real time.

curl http://httpbin.org/get

You will receive a small JSON document that echoes details about your request, including the URL, your IP as origin, your request headers, and any query parameters as args. If the output scrolls quickly, pipe it to a pager so you can scan it comfortably.

curl http://httpbin.org/get | less

You almost never need -X GET because GET is the default. Keeping commands short makes them easier to read, copy, and maintain in scripts or documentation.

Adding Query Parameters to a GET

APIs often filter, sort, or paginate through query strings. Since shells treat the ampersand as a control character, quote URLs that contain multiple parameters. httpbin is perfect here because it simply reflects whatever you send, letting you verify the exact parameters that reached the server.

curl "http://httpbin.org/get?search=sneakers&limit=10&page=2&sort=price"

In the response, check the args object to confirm searchlimitpage, and sort.

Inspecting HTTP Headers in GET Responses

Headers provide essential context for every request and response. Use -i to include response headers above the body, or -I to perform a HEAD request that fetches headers only.

curl -i http://httpbin.org/get
curl -I http://httpbin.org/get

Check the Content-Type to make sure you are receiving JSON (not HTML). Check Cache-ControlDate, and any server-specific headers for caching, timing, and behavior. When debugging for rate limits or proxies, headers are often the quickest way to find issues without going through an entire payload.

Fetching JSON with cURL

JSON is the common language for APIs. Tell the server you prefer JSON and practice the headers you would use in production.

curl -H "Accept: application/json" http://httpbin.org/get

This asks for JSON, but the server has the final say. To verify, include headers and check Content-Type:

curl -i -H "Accept: application/json" http://httpbin.org/get

Make the output easy to read while you debug:

curl -s http://httpbin.org/get | jq .

Keep secrets out of your history by using environment variables:

export API_TOKEN="your-secret"
curl -H "Authorization: Bearer $API_TOKEN" http://httpbin.org/get

If the response is large, save then search locally:

curl -o data.json http://httpbin.org/get

Following Redirects

Some URLs point you to a new location. By default, cURL stops at the redirect. Use -L to continue to the final URL.

curl -L "http://httpbin.org/redirect-to?url=http://httpbin.org/get"

Want to see the hop as it happens? Add -v. You can also cap how many redirects you will follow:

curl -L --max-redirs 5 "http://httpbin.org/redirect-to?url=http://httpbin.org/get"

If a site serves different content to browsers, try a user agent string:

curl -L -A "Mozilla/5.0" "http://httpbin.org/redirect-to?url=http://httpbin.org/get"

Sending Cookies with a GET

Sessions and personalization often rely on cookies. You can send them inline for quick tests or manage them with a file.

# Inline cookie
curl -b "username=JohnDoe; sessionId=12345" http://httpbin.org/get

Capture cookies the server sets, then reuse them later:

# Save cookies from the server
curl -c cookies.txt "http://httpbin.org/cookies/set?sessionId=12345"
# Send them back on the next request
curl -b cookies.txt "http://httpbin.org/cookies"

Cookie files keep commands tidy and reduce the risk of leaking sensitive values into shell history. Use separate files per environment to avoid mixing sessions.

An Overview of cURL GET Request Arguments

Here is a quick cheat sheet for cURL GET options. It lists each option with its short and long flags and a plain description, so you can spot the right switch fast.

Table with cURL GET request arguments.

Treat it like a menu. Show or fetch headers, follow redirects, set a user agent, send or save cookies, or write output to a file. Start with curl URL, then add only the flags you need. For reliability, use timeouts, -f, or --retry when it helps.

Wrap Up

cURL is a quick, dependable way to fetch data with GET requests. You can grab pages or API responses, add query params, read headers, follow redirects, send cookies, and save results to a file with just a few flags.

As your project grows, the open web brings real obstacles like rate limits, CAPTCHAs, and geo restricted content. This is where Anonymous Proxies helps. Our HTTP and SOCKS5 networks provide clean IP pools, country and city targeting, and either sticky or rotating sessions.

For more details, you can check our guide about cURL with proxy.

We offer highly secure, (Dedicated or Shared / Residential or Non-Residential) SOCKS5, Shadowsocks, DNS or HTTP Proxies.

DR SOFT S.R.L, Strada Lotrului, Comuna Branesti, Judet Ilfov, Romania

@2025 anonymous-proxies.net