Como usar: Conversor de cURL to Code
Conversor de cURL to Code é uma ferramenta online gratuita de Ferramentas para desenvolvedores que paste a curl command and get a ready-to-run JavaScript fetch or Python requests snippet with method, headers and body preserved instantaneamente no seu navegador. Cole seus dados, ajuste as opções e obtenha o resultado em tempo real — sem instalação, sem cadastro e sem enviar nada a servidores.
Usar Conversor de cURL to Code agora →
Descrição
Paste a curl command and get a ready-to-run JavaScript fetch or Python requests snippet with method, headers and body preserved.
- Ferramentas para desenvolvedores
- Como tudo roda no cliente, Conversor de cURL to Code é seguro para dados sensíveis como chaves de API e tokens.
Como usar
Usar Conversor de cURL to Code leva três passos:
- Cole os dados na caixa de entrada (ou carregue o exemplo).
- Configure as opções para o formato desejado.
- Copie, baixe ou inspecione a saída — atualiza ao digitar.
Executar
Exemplos
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}'
Saída
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
Situações comuns onde Conversor de cURL to Code ajuda:
- 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 ferramenta não tem opções — atua apenas sobre a entrada.
Perguntas frequentes
O que é cURL to Code Converter?
cURL to Code Converter serve para paste a curl command and get a ready-to-run JavaScript fetch or Python requests snippet with method, headers and body preserved. Roda inteiramente no navegador, mantendo seus dados privados.
É gratuito?
Sim, sem limites, sem cadastro nem instalação.
Meus dados são enviados?
Não. Tudo é processado localmente no seu navegador.
O que saber
- 全部计算在浏览器端完成,因此超大输入受限于标签页内存,而非服务器上传限制。
Ferramentas relacionadas
Conversor de cURL to Code → · Ferramentas para desenvolvedores →