🧰
TheDevToolbox
Search tools...
Ctrl+K
Blog
cURL Converter
cURL Converter
Convert cURL commands to code in multiple languages
POST request parsed
• 2 headers, has body
Output:
JavaScript (fetch)
Node.js (axios)
Python (requests)
PHP (cURL)
Go
Ruby
Convert
⌘↵
cURL Command
190 chars
curl -X POST 'https://api.example.com/users' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer your_token_here' \ -d '{"name": "John Doe", "email": "john@example.com"}'
Generated Code
11 lines
1
const
response =
await
fetch(
'https://api.example.com/users'
, {
2
method:
'POST'
,
3
headers: {
4
"Content-Type"
:
"application/json"
,
5
"Authorization"
:
"Bearer your_token_here"
6
},
7
body: JSON.stringify({
"name"
:
"John Doe"
,
"email"
:
"john@example.com"
}),
8
});
9
10
const
data =
await
response.json();
11
console.log(data);
⌘⇧C
Copy
Related Tools, Tips & More