cURL to Fetch / Axios
Convert cURL commands to JavaScript fetch() or axios code. Supports headers, JSON body, form data, basic auth, and more.
cURL Command
Tools run in your browser. Shared links may include your input; check the URL before sharing.
How to use
- Paste a cURL command and choose Fetch or Axios.
- Check the method, headers and body before copying the code.
This example illustrates one supported operation. Choose the matching mode and settings above; generated values and formatting may vary.
Example input or settings
curl 'https://api.example.com/users'Example result
const response = await fetch('https://api.example.com/users');Why does cURL work when the browser fails?
Browsers enforce cross-origin restrictions and restrict some headers. Check server CORS settings and the console.