Reading12 min
What Is HTTP and Why Everything Uses It
💻 Module 1: Terminal, HTTP & Your First API Call
What Is HTTP and Why Everything Uses It
HTTP stands for Hypertext Transfer Protocol. It is the language that every computer on the internet uses to talk to every other computer.
When you load a webpage, your browser sends an HTTP request. When an app checks the weather, it sends an HTTP request. When EnergyAtIt reads a battery, it sends an HTTP request.
The 4 HTTP Methods You Need
| Method | What It Does | Example |
|---|---|---|
| GET | Read data | Get meter readings |
| POST | Create something | Create a carbon record |
| PATCH | Update something | Update an asset config |
| DELETE | Remove something | Revoke an API key |
Status Codes — What the Server Tells You
| Code | Meaning | What to Do |
|---|---|---|
| 200 | Success | You're good |
| 201 | Created | Your POST worked |
| 400 | Bad Request | Check your JSON body |
| 401 | Unauthorized | Your API key is wrong or missing |
| 403 | Forbidden | You don't have permission for this |
| 404 | Not Found | Wrong URL |
| 429 | Rate Limited | Slow down, wait, retry |
| 500 | Server Error | Not your fault. Retry later. |
The Anatomy of an API Request
Every API request has 4 parts:
- URL: Where to send it —
https://app.energyatit.com/api/v1/sites - Method: What to do — GET, POST, PATCH, DELETE
- Headers: Metadata — especially
Authorizationfor your API key - Body: The data (for POST/PATCH) — always JSON
JSON — The Universal Format
JSON (JavaScript Object Notation) is how APIs send and receive data:
{
"success": true,
"data": {
"id": 1,
"name": "Dubai Solar Farm",
"capacity_mw": 10
}
}Every EnergyAtIt API response follows this format: { success, data?, error?, details? }
Log in to track your progress and earn certifications.