Skip to content

cURL a Fetch / Axios

Convierte comandos cURL en código de JavaScript fetch, Axios o Python requests, con cabeceras, cuerpo, autenticación y método.

Sin subidas
const res = await fetch('https://api.example.com/v1/users?team=core', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer TOKEN'
  },
  body: JSON.stringify({
    "name": "Ada",
    "role": "admin"
  })
});
const data = await res.json();
console.log(data);

Cómo usar cURL a Fetch / Axios

  1. 1Abre cURL a Fetch / Axios. Funciona en tu navegador, sin registro.
  2. 2Escribe o pega tus datos.
  3. 3Copia o descarga el resultado.

Preguntas

Which curl options are supported?

Method (-X), headers (-H), data (-d, --data-raw, --data-urlencode, --json), basic auth (-u), forms (-F), cookies (-b), user agent (-A), -G and -I. Cosmetic flags like -s, -L and --compressed are ignored.

Can I paste a command from Chrome DevTools?

Yes — “Copy as cURL (bash)” output works, including multi-line commands with backslashes.

Are my tokens safe?

Yes. Conversion happens in your browser; nothing is sent anywhere.

Más herramientas