[Avg. reading time: 5 minutes]
HTTP Basics
HTTP (Hypertext Transfer Protocol) is the foundation for data communication on the web.
Common HTTP Methods
| Method | Description | Typical Use |
|---|---|---|
| GET | Retrieve data | Fetch a resource (read-only) |
| POST | Create new data | Add new records or trigger an action |
| PUT | Replace data | Update/replace an existing record |
| DELETE | Remove data | Delete a record |
Popular HTTP Status Codes
200 Series (Success): 200 OK, 201 Created.
300 Series (Redirection): 301 Moved Permanently, 302 Found.
400 Series (Client Error): 400 Bad Request, 401 Unauthorized, 404 Not Found.
500 Series (Server Error): 500 Internal Server Error, 503 Service Unavailable.
REST API
REpresentational State Transfer is a software architectural style developers apply to web APIs.
REST APIs provide simple, uniform interfaces because they can be used to make data, content, algorithms, media, and other digital resources available through web URLs. Essentially, REST APIs are the most common APIs used across the web today.
https://api.zippopotam.us/us/08028
http://api.tvmaze.com/search/shows?q=friends
https://jsonplaceholder.typicode.com/posts
https://jsonplaceholder.typicode.com/posts/1
https://jsonplaceholder.typicode.com/posts/1/comments
https://reqres.in/api/users?page=2
https://reqres.in/api/users/2
CURL & VSCode
curl is a CLI application available for all OS.
https://curl.se/windows/
curl https://api.zippopotam.us/us/08028
curl https://api.zippopotam.us/us/08028 -o zipdata.json