Spoold/

curl → Code

curl Command
Valid
Request Breakdown
POSThttps://api.example.com/users
Headers:
Content-Type:application/json
Authorization:Bearer token123
Body (json):
{
  "name": "John Doe",
  "email": "john@example.com"
}
Output Format
Generated Code
fetch("https://api.example.com/users", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer token123"
  },
  body: JSON.stringify({"name": "John Doe", "email": "john@example.com"})
})
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error("Error:", error));