Convert cURL commands to Python requests, JavaScript fetch, PHP cURL, Go http, PowerShell, and Node.js Axios — instantly in your browser.
Paste any cURL command including headers, body, and auth flags
Method:
POST
URL:
https://api.example.com/users
import json
import requests
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer TOKEN123"
}
data = json.loads("{\"name\":\"John\",\"email\":\"[email protected]\"}")
response = requests.post("https://api.example.com/users", headers=headers, json=data)
print(response.json())fetch("https://api.example.com/users", {
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer TOKEN123"
},
"body": "{\"name\":\"John\",\"email\":\"[email protected]\"}"
})
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error(err));<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.example.com/users");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json",
"Authorization: Bearer TOKEN123"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"name\":\"John\",\"email\":\"[email protected]\"}");
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>package main
import (
"fmt"
"net/http"
"strings"
)
func main() {
body := strings.NewReader("{\"name\":\"John\",\"email\":\"[email protected]\"}")
req, _ := http.NewRequest("POST", "https://api.example.com/users", body)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer TOKEN123")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
fmt.Println(resp.Status)
}$headers = @{
"Content-Type" = "application/json";
"Authorization" = "Bearer TOKEN123"
}
$response = Invoke-RestMethod -Uri "https://api.example.com/users" ^
-Method "POST" ^
-Headers $headers ^
-Body "{\"name\":\"John\",\"email\":\"[email protected]\"}"
$responseconst axios = require('axios');
axios.post("https://api.example.com/users", {
"name": "John",
"email": "[email protected]"
}, {
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer TOKEN123"
}
})
.then(response => console.log(response.data))
.catch(error => console.error(error));cURL is a command-line tool for making HTTP requests. While it is excellent for quick tests, you often need to reproduce the same request in your application code. This converter parses your cURL command and generates equivalent code in six popular languages and frameworks.
-X / --request
HTTP method (GET, POST, PUT, DELETE, PATCH)
-H / --header
Request headers (can be repeated)
-d / --data
Request body (string or JSON)
-u / --user
Basic auth credentials (user:password)
--data-raw
Raw body data without processing
-L / --location
Follow redirects (parsed, ignored in output)
curl -X POST https://api.example.com/v1/users -H "Authorization: Bearer token123" -d '{"name":"Alex"}'const res = await fetch('https://api.example.com/v1/users', {
method: 'POST',
headers: { 'Authorization': 'Bearer token123', 'Content-Type': 'application/json' },
body: JSON.stringify({ name: 'Alex' })
});Extracts URL, method, headers, and automatically serializes the JSON body payload.
Yes. It correctly parses `-F` flags and outputs appropriate FormData construction for Fetch, Python Requests, and Axios.
No. The entire cURL parsing and code generation pipeline runs 100% client-side in your browser.
Explore more free utilities in Development
Regex Tester
Real-time regular expression tester with highlighting and cheat sheet.
Open
JSON Diff
Compare two JSON objects structurally to find differences.
Open
Subnet Calculator
Calculate IP ranges, netmasks, and CIDR subnet details.
Open
Cron Generator
Visual builder for Cron schedules with next-run previews.
Open
CSS Box Shadow
Visually design and generate CSS box-shadow code.
Open
Gitignore Generator
Create custom .gitignore files for your projects instantly.
Open