Hands-On RESTful API Design Patterns and Best Practices
by Harihara Subramanian J, Anupama Murali, Pethuru Raj
Idempotent REST APIs
If we make multiple identical requests and receive the same response every time, the APIs are generally called idempotent. Some API consumers knowingly or unknowingly make the same request twice or thrice. The APIs have to understand this and reply with the same response.
The point is that we have to build and deploy intelligent APIs. One trait of them is the idempotent APIs. We have to have idempotent REST APIs for all the standard HTTP operations, such as GET, PUT, and DELETE. Only POST APIs will not be idempotent.
As previously mentioned, RESTful communication takes place on the HTTP protocol, and the HTTP commands are being used by the REST client to interact with the REST server. This uniformity and simplicity works ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access