CURL REQUEST BUILDER

curl Request Builder

Build a curl command from method, headers, auth, body, and options — assembled live with correct POSIX quoting and a copy button.

Fill in the request — the curl command assembles live below with every flag explained. Arguments are single-quoted for POSIX shells (bash, zsh).

curl

Single quotes protect the shell on bash and zsh. In Windows cmd.exe swap them for double quotes; PowerShell needs the --% stop-parsing token (or backtick escaping) for bodies with special characters.

curl 101

What curl does

curl transfers data to or from a server from the command line. For HTTP it's the quickest way to reproduce an API call, debug a header, or script a request. The builder above maps each control onto a flag; this is what they mean.

The core flags

flagmeaning
-X METHODset the HTTP method. GET is the default, so it's omitted; -I is the shortcut for a HEAD request.
-H 'Name: value'add a request header. Repeat it for as many as you need.
--data-raw '…'send a request body verbatim (and imply POST). Plain -d treats a leading @ as "read a file", which --data-raw avoids.
-u user:passHTTP basic auth. For bearer tokens use -H 'Authorization: Bearer …' instead.

Handy options

  • -L — follow 3xx redirects to the final URL.
  • -i — include the response headers in the output; -v shows the full request/response conversation (great for debugging); -s silences the progress meter.
  • --compressed — request gzip/deflate and decode it for you.
  • -k — skip TLS certificate verification. Handy against a lab box with a self-signed cert; never use it against anything you actually trust.
  • -o file — write the body to a file instead of the terminal (-O reuses the remote filename).

Quoting

The builder single-quotes every argument, which is correct for bash and zsh: single quotes are literal, so JSON, spaces, and & are all safe. On Windows cmd.exe use double quotes instead; PowerShell parses -d/& specially, so prefix the arguments with the --% stop-parsing token for complex bodies.

A quick debugging recipe

curl -sv -H 'Accept: application/json' https://api.example.com/health

-s hides noise, -v shows the negotiated TLS, request headers, and response status — usually enough to see why a call misbehaves.