Cómo usar: Conversor de cURL to Code
Conversor de cURL to Code es una herramienta online gratuita de Herramientas para desarrolladores que paste a curl command and get a ready-to-run JavaScript fetch or Python requests snippet with method, headers and body preserved al instante en tu navegador. Pega tus datos, ajusta las opciones y obtén el resultado en tiempo real: sin instalación, sin registro y sin subir nada a un servidor.
Usar Conversor de cURL to Code ahora →
Descripción
Paste a curl command and get a ready-to-run JavaScript fetch or Python requests snippet with method, headers and body preserved.
- Herramientas para desarrolladores
- Como todo se calcula en el cliente, Conversor de cURL to Code es seguro para datos sensibles como claves API o tokens.
Cómo usar
Usar Conversor de cURL to Code requiere tres pasos:
- Pega tus datos en la caja de entrada (o carga el ejemplo).
- Ajusta las opciones al formato o escenario deseado.
- Copia, descarga o revisa la salida: se actualiza mientras escribes.
Ejecutar
Ejemplos
A JSON POST with two headers — the fetch snippet keeps method, headers and the raw JSON body.
Entrada
curl -X POST 'https://api.example.com/v1/orders' -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"item":"pen","qty":3}'
Salida
const url = 'https://api.example.com/v1/orders';
// Runs inside an async function (or a module / Node 18+ REPL):
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
},
body: '{"item":"pen","qty":3}',
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json(); // .text() for non-JSON bodies
console.log(data);
此输出由工具真实运行产生,并非人工编写。
Casos de uso
Situaciones habituales donde Conversor de cURL to Code ayuda:
- Paste a curl command and get a ready-to-run JavaScript fetch or Python requests snippet with method, headers and body preserved.
Parámetros
Esta herramienta no tiene opciones: trabaja solo con la entrada.
Preguntas frecuentes
¿Qué es cURL to Code Converter?
cURL to Code Converter sirve para paste a curl command and get a ready-to-run JavaScript fetch or Python requests snippet with method, headers and body preserved. Funciona íntegramente en tu navegador, así tus datos siguen siendo privados.
¿Es gratuito?
Sí, sin límites, sin registro y sin instalación.
¿Se suben mis datos?
No. Todo se procesa localmente en tu navegador.
A tener en cuenta
- 全部计算在浏览器端完成,因此超大输入受限于标签页内存,而非服务器上传限制。
Herramientas relacionadas
Conversor de cURL to Code → · Herramientas para desarrolladores →