artisan.dev

cURL Command Builder

Essentials
KeyValue
Generated cURL
enter a URL to generate
1
$ curl <waiting for a valid URL…>

How to build — or take apart — a cURL command

This cURL builder turns a form into a correct, copy-ready curl command: choose the method and URL, add headers, a body, authentication and common flags, and the command updates as you type, neatly split across lines. It also works in reverse — paste an existing cURL command (for example from your browser's "Copy as cURL" or from API documentation) and it is broken back down into editable fields.

Quoting is handled for you, so values containing spaces, quotes or JSON come out safe to paste into a terminal. Nothing is sent anywhere: the tool only writes the command, it doesn't execute requests.

How to use the cURL builder

  1. Choose the HTTP method (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS) and enter the URL.
  2. On the Headers tab add key/value pairs — common names and values such as Content-Type: application/json are suggested.
  3. On the Body tab choose raw (JSON or text), multipart/form-data or x-www-form-urlencoded. For a raw JSON body, the Content-Type header is added automatically if you haven't set one.
  4. On the Auth tab add Basic credentials (as -u or as an Authorization header) or a Bearer token.
  5. On Options toggle flags like -L (follow redirects), -i (show response headers), -k (skip TLS verification), -v (verbose) or a --proxy, and optionally pipe the output to jq.
  6. Copy the generated command. To edit an existing command instead, click Import cURL and paste it.

A POST with a JSON body and bearer token comes out like this:

curl -X POST 'https://api.example.com/v1/orders' \
  -H 'Authorization: Bearer eyJhbGciOi…' \
  -H 'Content-Type: application/json' \
  --data-raw '{"sku":"A-100","qty":2}'

The cURL flags you'll use most

FlagPurpose
-X POSTSet the HTTP method (GET is the default; -d implies POST)
-H 'Name: value'Add a request header
-d / --data-rawSend a request body; --data-raw doesn't treat a leading @ as a filename
--data-urlencode 'k=v'URL-encode a form field for you
-F 'file=@photo.jpg'Send multipart form data, including file uploads
-u user:passHTTP Basic authentication
-LFollow redirects
-i / -vInclude response headers / show the full request and response exchange
-kSkip TLS certificate verification — for local testing only
-x / --proxySend the request through a proxy

Common problems

  • Quotes break the command. In bash and zsh, single quotes are safest; a single quote inside the value must be written as '\''. The builder escapes this for you. Windows cmd.exe doesn't support single quotes at all — use PowerShell or Git Bash, or replace with escaped double quotes.
  • 415 Unsupported Media Type. The server didn't get the Content-Type it expects. Add Content-Type: application/json for JSON bodies.
  • Body sent as form data instead of JSON. -d without a content type sends application/x-www-form-urlencoded. Set the header explicitly.
  • Redirect returns an empty body. Add -L; by default curl doesn't follow 301/302 responses.
  • curl: (60) SSL certificate problem. The server's certificate isn't trusted. Fix the certificate chain; use -k only against local or test servers.

Keeping credentials safe

A command copied from DevTools often contains live cookies and tokens. Deconstructing it here is safe because nothing leaves your browser, but be careful where you paste the result afterwards — shell history, chat and tickets keep it. Prefer environment variables in shared commands, e.g. -H "Authorization: Bearer $API_TOKEN". To inspect a token you find in a command, use the JWT decoder; to prepare a JSON body, use the JSON formatter.

Frequently asked questions

Does this tool send the request?

No. It only generates and parses cURL commands in your browser. Run the command yourself in a terminal.

Can I import a command from Chrome DevTools?

Yes. In the Network panel, right-click a request and choose Copy → Copy as cURL (bash), then click Import cURL and paste it. Method, URL, headers, body, auth and common flags are extracted into fields.

What's the difference between -d and --data-raw?

Both send a request body. With -d, a value starting with @ is read from a file; --data-raw sends the text exactly as written.

How do I send JSON with curl?

Use -X POST, add -H 'Content-Type: application/json' and pass the JSON with --data-raw '{"key":"value"}'. Choose the raw JSON body type in the builder and it does all three.

Related tools