A real request and response
Here's what an actual API call looks like end to end — the request your app sends, and the JSON it gets back:
GET /forecast?city=London HTTP/1.1
Host: api.weather.com
Authorization: Bearer sk_live_8f4b2c...
Accept: application/json
{
"city": "London",
"unit": "celsius",
"current": {
"temp": 14,
"condition": "cloudy"
},
"forecast": [
{ "day": "Mon", "high": 16, "low": 9 },
{ "day": "Tue", "high": 18, "low": 11 }
]
}
That Authorization line is the next topic — and the one most worth getting right.