REST api
What is rest
The term REST stands for REpresentational State Transfer. It is an architectural style that defines a set of rules in order to create Web Services.
REST suggests to create an object of the data requested by the client and send the values of the object in response to the user. you have an object and you are sending the state of an object. This is why REST is known as Representational State Transfer.
Methods of REST API
GET | POST | PUT | PATCH | |
---|---|---|---|---|
Usage | get data | insert data | update data(whole) | udpate data(partial) |
Safe | O | X | X | X |
Idempotent | O | X | O | X |
Idempotent
When an HTTP method is idempotent in a REST API, this means that if you send multiple identical requests, only the initial request would cause a change
Another topic: Idempotent key design(from stripe?)