See how to make HTTP requests across different programming languages. From Node.js with fetch and axios, to Python with requests and httpx, Go with net/http. Each example shows POST requests with JSON payloads and proper headers.
// Node.js HTTP request using fetch (Node 18+)
const response = await fetch('https://api.example.com/data', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer your-token-here'
},
body: JSON.stringify({
name: 'John Doe',
email: 'john@example.com'
})
});
const data = await response.json();
console.log('Response:', data);