Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use curl followed by a URL to make a basic request:

curl https://example.com

That command transfers the response body to your terminal. From there, options let you follow redirects, add headers, submit form or JSON data, save output, inspect the exchange, and control the HTTP method. This guide builds useful commands from that starting point and explains the details that commonly cause failures.

What the cURL command does

curl is a command-line tool for transferring data to or from a server using URLs. Its documented syntax is curl [options / URLs]; arguments that are not recognized as options or option arguments are treated as URLs. The examples below follow the official curl manual, whose current online version describes curl 8.23.0. Your installed build may be older and may not support every option.

Check your installed version first

curl --version
curl --help

--version shows the installed release, protocols and TLS details. --help provides the option names available in that build. Use the local help when a copied command reports an unknown option.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Make a GET request

Print a page or API response

curl https://example.com

With no method or body option, curl makes an HTTP GET request and writes the response body to standard output. For an API, the output is often JSON; for a website, it is usually HTML.

Follow redirects

curl -L https://example.com

-L (or --location) makes curl repeat a request when the server returns a 3xx response with a Location header. When a redirect changes the origin, curl does not forward authorization and cookie credentials by default. This protects credentials from being sent to an unrelated host.

Send query parameters with GET

curl --get --data-urlencode 'q=curl command' https://example.com/search

--get (or -G) places data options in the URL query string instead of creating a POST body. --data-urlencode safely encodes spaces and punctuation. You can repeat it for multiple parameters.

Add headers and authentication

Add one or more request headers

curl -H 'Accept: application/json' https://api.example.com/items
curl -H 'Accept: application/json' -H 'X-Request-ID: demo-123' https://api.example.com/items

-H (or --header) adds a header and can be used repeatedly. Quote the entire header so the shell passes it as one argument.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a bearer token

curl -H "Authorization: Bearer $API_TOKEN" 
  -H 'Accept: application/json' 
  https://api.example.com/items

Keeping the token in an environment variable avoids placing it directly in shell history. Do not paste live credentials into scripts that will be committed or shared.

Submit form data with POST

curl -d 'name=curl' https://example.com/submit

-d (or --data) sends an HTTP POST for HTTP(S) URLs and uses the application/x-www-form-urlencoded content type. Repeating data options joins the fields with ampersands:

curl -d 'name=curl' -d 'topic=cli' https://example.com/submit

For data read from a file, --data removes carriage returns, newlines and null bytes. Use --data-binary when those bytes must be preserved.

Read form fields from a file

curl --data-binary @payload.bin https://example.com/upload

The @ prefix tells curl to read the request body from the named file. Confirm the server expects that exact encoding; binary data is not automatically converted to multipart form upload.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Send JSON correctly

curl --json '{"name":"curl","enabled":true}' https://api.example.com/items

--json is a shortcut for sending binary data with Content-Type: application/json and Accept: application/json. It was added in curl 7.82.0, so older installations may reject it. The option does not validate that the supplied text is valid JSON.

Portable JSON syntax for older curl versions

curl -X POST 
  -H 'Content-Type: application/json' 
  -H 'Accept: application/json' 
  --data '{"name":"curl","enabled":true}' 
  https://api.example.com/items

Prefer a dedicated data option over manually changing the method whenever possible. The data option establishes the body and normally selects POST for you.

Save responses and inspect transfers

Write the response body to a file

curl -o response.txt https://example.com
curl -o page.html -L https://example.com

-o (or --output) writes the response body to the specified file instead of the terminal. Use a separate output filename for each URL when running multiple downloads.

See request and response details

curl -v https://example.com

-v (or --verbose) prints connection, request-header and response-header information. Diagnostic lines are written separately from the response body, so you can combine verbose logging with -o. Avoid verbose output when it could expose authorization headers or cookies in a shared log.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Fetch headers only

curl -I https://example.com

-I (or --head) performs a proper HEAD request and returns headers without the response body. This is preferable to -X HEAD; merely replacing the method token does not configure all behavior required for a correct HEAD request.

Choose methods without breaking curl’s behavior

-X METHOD (or --request METHOD) replaces the literal HTTP method word. It does not automatically add a body, headers or other method-specific behavior. For GET, HEAD, POST and PUT, the manual recommends dedicated options such as --get, --head and data or upload options.

Goal Use What it changes
Normal GET curl URL Fetches the response body
GET with query data curl --get --data-urlencode 'key=value' URL Appends an encoded query string
HEAD curl --head URL Sends HEAD and returns headers
Form POST curl --data 'key=value' URL Sends URL-encoded POST data
JSON POST curl --json '{...}' URL Sends JSON plus JSON headers (curl 7.82.0+)
Explicit method token curl --request PATCH URL Changes only the method word; configure body and headers separately

Shell quoting, URLs, and multiple requests

Quote characters that the shell can interpret

Characters such as &, spaces, braces and brackets can be interpreted by your shell or by curl’s URL globbing. Quote a complete URL or data argument:

curl 'https://example.com/search?q=red&sort=new'

If you need literal braces or brackets that curl would treat as a URL pattern, disable globbing:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl --globoff 'https://example.com/files/[2026]/report{a,b}.pdf'

Request several URLs

curl https://example.com/one https://example.com/two

Each non-option argument is a URL. For repeatable downloads, combine multiple URLs with output naming patterns only when you understand how your shell and curl expand them; otherwise provide explicit URLs and output files.

Make failures visible to scripts

curl --fail --silent --show-error -o response.json https://api.example.com/items

A transfer can complete successfully even when the server returns an HTTP error page. --fail makes curl return an error for HTTP error responses instead of treating the error body as an ordinary successful transfer. --silent suppresses the progress meter, while --show-error keeps useful error messages. This combination is suitable for automation that checks the process exit status.

Keep headers and body separate

curl --fail --dump-header response.headers -o response.body https://api.example.com/items

--dump-header records response headers while -o stores the body. This makes status, content type and caching information available without mixing them into the payload.

Reliable command patterns

API GET with redirect handling and diagnostics

curl --fail --location 
  -H 'Accept: application/json' 
  -H "Authorization: Bearer $API_TOKEN" 
  -o items.json 
  https://api.example.com/items

JSON request with a status check

curl --fail --silent --show-error 
  --json '{"name":"curl"}' 
  https://api.example.com/items

Investigate a problem without saving the body

curl --verbose --location https://example.com
  1. Run curl --version to verify option availability.
  2. Add --verbose to see DNS, TLS, redirects and headers.
  3. Add --location if the response is a redirect.
  4. Use --fail in scripts so HTTP errors affect the exit status.
  5. Check that the URL, content type, authentication and body encoding match the server’s API contract.

Common errors and fixes

“Unknown option” or an option behaves differently

Your installed curl may predate the option. Check curl --version and curl --help. For JSON on versions before 7.82.0, replace --json with explicit Content-Type, Accept and --data options.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The terminal shows an HTML error page but the command exits successfully

Without --fail, curl can download an HTTP error response as a normal body. Add --fail --show-error, then inspect the status and headers with --verbose or --dump-header.

Query parameters are missing or split

The shell likely interpreted & or spaces. Quote the URL, or use --get --data-urlencode so curl constructs the query string.

The API rejects the body

Check whether the endpoint expects URL-encoded form data, JSON or binary bytes. Use --json for supported curl versions, or set the JSON headers explicitly. Remember that curl does not validate JSON syntax; validate the document separately if necessary.

A redirected request loses authentication

curl restricts authorization and cookie forwarding when a redirect moves to a different origin. Verify the redirect target and authenticate deliberately there rather than broadly forwarding secrets.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

-X HEAD returns unexpected behavior

Use -I or --head. Changing only the method token does not provide the complete HEAD behavior.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance, safety, and operational notes

  • Write large responses with -o instead of flooding a terminal.
  • Use --silent --show-error in scripts to remove progress noise while preserving failures.
  • Quote URLs and data consistently across Bash, Zsh, PowerShell and other shells; quoting rules differ.
  • Do not expose tokens through verbose logs, shell history or world-readable scripts.
  • Pin commands to options supported by the curl version installed on the target machine.
  • When diagnosing a timeout or TLS problem, verbose output identifies the stage that failed; it does not by itself prove that the remote application is healthy.

Or skip the browser setup: capture a URL with ScreenshotNeo

If your goal is a clean website screenshot rather than a raw HTTP response, ScreenshotNeo provides a single GET request. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups and chat widgets. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and response headers identify the page verdict and billing result.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for all parameters. The service also offers an MCP server with take_screenshot, get_page_info and capture_pdf tools for Claude, Cursor and other MCP clients. Options include full-page and element captures, device presets, retina scale, dark mode, PDF settings, custom CSS and JavaScript, clicks, waits, request blocking, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, configurable caching, signed links, asynchronous webhooks, bulk capture of up to 100 URLs per call, a usage API and an OpenAPI specification.

The Free plan includes 1,000 screenshots per month without a card. Paid plans start at $5 for 3,000 shots; every feature is available on every plan. Create a free ScreenshotNeo account to try it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Does curl download a website’s rendered JavaScript view?

No. curl transfers the HTTP response it receives; it does not execute browser JavaScript or display a page like a browser. Use a browser automation tool or ScreenshotNeo when you need a rendered screenshot.

Can I use curl on Windows?

Yes, current Windows installations commonly include curl. Run curl --version in PowerShell or Command Prompt because quoting and environment-variable syntax differ from Unix shells.

What does curl’s exit status tell a script?

It reports whether curl completed its transfer operation. Add --fail when HTTP error statuses should also produce a failure instead of downloading an error body.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.