Foundation
What an API is and how a request flows
Use a live game-inventory API to see GET retrieve data, POST create an item, PUT upgrade an item, and DELETE remove one.
FoundationGETPOSTPUTDELETERequest bodyStatus codeJSON response
Why it matters
APIs are easier to understand when you can watch the page ask, the API check the request, the data change, the response return, and the screen update.
Field notes
- GET retrieves data without changing it.
- POST creates a new resource, usually using a request body.
- PUT updates an existing resource by id.
- DELETE removes a resource by id.
- The API's full job is to receive the request, validate it, work with data, return a response, and let the frontend update.