Paste a cURL command to inspect, format, and edit it.



Generated cURL
Copied!

            

Code Examples

How to execute equivalent HTTP requests in various languages.

Snippet Copied!
// Using Fetch API (Modern)
fetch('https://api.example.com/v1/resource', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        'Authorization': 'Bearer token'
    },
    body: JSON.stringify({
        key: 'value'
    })
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));