Generador de Curl

Build a correctly quoted curl command from a form, updating as you type

100% gratis. Funciona completamente en tu navegador: tus archivos y datos nunca salen de tu dispositivo y no se sube nada a ningún servidor.

Query parameters
Headers
Authentication
Body
Options
Command
curl \
  -L \
  -H 'Accept: application/json' \
  'https://api.example.com/v1/users'

Values are quoted for the shell you picked, so tokens and passwords containing $, spaces or quotes are passed through literally instead of being expanded.

Acerca de esta herramienta

curl is the fastest way to describe an HTTP request precisely, and the easiest thing in the world to get subtly wrong. This generator builds the command from a form - method, URL, query parameters, headers, authentication, and a JSON, form-data or URL-encoded body - and updates the output on every keystroke so you can see exactly which flag each option adds. The part it takes seriously is quoting: values are escaped for the shell you actually use, so a token containing a dollar sign, a password with a space, or a JSON body with an apostrophe are passed through literally instead of being mangled or expanded by the shell. It also leaves out redundant flags, so you get the command an experienced user would have written rather than a noisy one.

Cómo usar esta herramienta

  1. Pick a method and enter the URLGET, POST, PUT, PATCH, DELETE, HEAD or OPTIONS.
  2. Add query parametersEntered as name and value pairs and URL-encoded for you, so spaces and ampersands are safe.
  3. Add headers or authenticationBearer tokens become an Authorization header; basic auth uses curl -u so curl does the encoding.
  4. Choose a body typeJSON is validated as you type. Form data supports file uploads with the @ prefix.
  5. Pick your shell and copybash/zsh, PowerShell or cmd.exe. The quoting and the line-continuation character change to match.

Por qué usarla

  • Quotes every value for the shell you selected, so tokens and passwords with special characters survive intact.
  • Uses the correct line-continuation character per shell - the wrong one silently runs only the first line.
  • Leaves out redundant flags such as -X POST alongside -d, so the command teaches good habits.
  • Validates a JSON body as you type, before you paste a broken request into a terminal.
  • Never overrides a Content-Type you set yourself.
  • Runs entirely in your browser - your URLs, tokens and request bodies are never sent anywhere.

Usos comunes

  • Turning an API doc example into a command you can actually run.
  • Sharing a reproducible request in a bug report or with a teammate.
  • Building a request for a CI script or a cron job.
  • Learning which curl flag corresponds to which part of an HTTP request.
  • Testing an endpoint quickly without opening a heavier API client.

Consejos para mejores resultados

  • Pick the right shell before copying. PowerShell and cmd need different quoting and continuations from bash, and a command copied from one into the other often fails in confusing ways.
  • Use -i while debugging so you can see status codes and response headers, not just the body.
  • Prefix a form value with @ to upload a file: @/path/to/photo.png.
  • Only use -k when testing against a self-signed certificate. It disables TLS verification entirely, so never leave it in a script that touches production.

Errores a evitar

  • Copying a bash command into PowerShell. The backslash continuations and single quotes do not carry over.
  • Writing your own base64 Authorization header instead of using -u, which breaks with non-ASCII passwords.
  • Adding -X POST alongside -d, which is redundant and can cause surprising behaviour after a redirect.
  • Leaving a real API token in a command pasted into a public issue or chat.

Preguntas frecuentes

No. It only builds the text of a command. Nothing is executed and nothing is transmitted - the URL, headers, tokens and body you type never leave your browser. Running the command is entirely up to you, in your own terminal.

Because curl already switches to POST as soon as a body is present with -d. Adding -X POST as well is redundant, and it can change behaviour after a redirect in ways people do not expect. The flag is only emitted when it actually changes the request.

Whichever you will paste into. bash/zsh covers Linux, macOS and WSL. PowerShell and cmd.exe are different enough that a bash command usually fails in them - the quoting rules and the line-continuation character are both different.

Choose the Form data body type and prefix the value with an @, for example @/tmp/photo.png. That is curl syntax for reading the field value from a file.

The command uses curl -u, which lets curl do the encoding correctly, including for non-ASCII passwords. Remember that basic auth only protects credentials in transit if the URL is https, and be careful about pasting real credentials anywhere public.

Form data (-F) sends multipart/form-data and is what you need for file uploads. URL encoded (--data-urlencode) sends application/x-www-form-urlencoded, which suits simple key and value pairs and is what most HTML forms post.

Not currently - this builds a command from the form rather than parsing one. If you need to modify an existing command, fill in the fields to match and copy the fresh output.

Related guides