DevToolbox

โ†‘ โ†“ to select ยท Enter to open ยท Esc to close

cURL to Code Converter

Convert common cURL requests into Fetch, Axios, or Python Requests code locally.

fetch("https://example.com/api/users?active=1", {
  method: "POST",
  headers: {"Content-Type":"application/json"},
  body: "{\"name\":\"Ada\"}",
});

How to use the cURL to Code Converter

Convert common cURL requests into Fetch, Axios, or Python Requests code locally.

Steps

  1. Paste a cURL command containing an HTTP or HTTPS URL.
  2. Choose Fetch, Axios, or Python Requests.
  3. Review the generated request and remove any embedded credentials before sharing it.

Example: A GET request

curl https://example.com/api/users

Limitations

The parser supports common method, header, URL, and body flags. It does not execute shell commands or support every cURL option; check the generated request before using it.