Curl to Code
Turn a curl command into fetch, Python requests, PHP or Go code.
What it does
Rewrites a curl command as code in JavaScript fetch, Python requests, PHP or Go. API docs and browser developer tools often give requests as curl, and this turns them into something you can use in your program. Headers, body and method are kept.
Related tools
More in Developer Generators
UUID Generator
Make random version 4 UUIDs, one or a thousand at a time.
Password Generator
Make random passwords of any length and character set.
Cron Expression Generator
Build a cron line by picking minutes, hours and days.
Chmod Calculator
Turn Unix permissions into 755-style numbers and rwx letters, and back.
.htaccess Generator
Write redirects, HTTPS rules and caching headers for Apache.
robots.txt Generator
Write a robots.txt file with rules for each crawler and a sitemap line.
Meta Tag Generator
Write the title, description and robots tags of a page.
Test Data Generator
Make rows of fake names, addresses, dates and numbers as CSV or JSON.
Curl to Code questions
How do I use the Curl to Code?
Paste the text into the Input box or open a file, set the options, then copy or download the result.