Introduction to API
API --> Application Programming Interface
, is defined as a set of rules or protocols that are set to enable two software to communicate with each other.
There are several types of API’s example SOAP
, XML-RPC
or REST
This article will focus more on REST API.
Rest API stands for REpresentational State Transfer
→ It is a set of functions (GET, POST,PUT or Delete) that enables clients to perform CRUD
operations that include Create , Read, Update and Delete
resources in the data server.
There are Six REST API design principles.
- Uniform interface
- Stateless
- Client-server decoupling
- Cacheable
- Code on Demand
- Layered System
Rest API HTTP Methods
- GET → Request Data from a server.The response contains all details requested.
- POST→Create new resources on the server.
- PUT→Update a Resource in the specified URL.
- DELETE→Delete a Resource in the Specified URL.
Top comments (2)
Also don't forget the PATCH.
With Patch if you have a whole object, you can just update only the persons birth-date for example. Instead of doing a get, and then needing to give the whole object back.
Thank you for the reminder, I appreciate.