Large set of unknown developers (LSUDs) VS. Small set of known developers (SSKDs) and HTTP idempotent f(f(x)) = f(x)

A very thoughtful post about one API design principle. http://www.danieljacobson.com/blog/tag/sskd

  • Large set of unknown developers (LSUDs) VS. Small set of known developers (SSKDs)

HTTP 1.1:

Methods can also have the property of “idempotence” in that (aside from error or expiration issues) the side-effects of N > 0 identical requests is the same as for a single request.

https://www.cnblogs.com/weidagang2046/archive/2011/06/04/idempotence.html

In my current project, all of the developers have to follow SSKD (because we are working on an in-house product) and our APIs must to support idempotent operation.

For the idempotent operation, we use a ‘version’ in each request, if the ‘version’ of a request has been proceeded, the server will not proceed its subsequent duplicated requests; the server will return the same result for the same requests.

 

Post or Put: https://stackoverflow.com/questions/630453/put-vs-post-in-rest