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.
1// Node.js HTTP request using fetch (Node 18+)2const response = await fetch('https://api.example.com/data', {3 method: 'POST',4 headers: {5 'Content-Type': 'application/json',6 'Authorization': 'Bearer your-token-here'7 },8 body: JSON.stringify({9 name: 'John Doe',10 email: 'john@example.com'11 })12});13 14const data = await response.json();15console.log('Response:', data);16 17// Alternative using axios18const axios = require('axios');19const result = await axios.post('https://api.example.com/data', {20 name: 'John Doe',21 email: 'john@example.com'22});