Most APIs will require some form of non-blocking or asynchronous mechanisms for specific endpoints. It could be an
import task that takes minutes or hours, report generation, or even deleting a resource. In any case, whatever the caller
is asking for can't be done immediately...
In the last post, we discussed the idempotency-key header, and how this header can be used to add
idempotence to otherwise non-idempotent HTTP methods (like POST) in REST APIs. We also touched on how many
HTTP methods are inherently idempotent, like DELETE. But just how idempotent is it, in practice?
In Computer Science (and in its cooler older sibling, Mathematics) idempotence is a property of an action
(e.g. an API call) such that doing the action again with the same inputs produces the same result. In the context
of HTTP, a GET request is usually idempotent...
It's 2021, and you work for Cat Bonnets Online. The bigwigs up on the top floor
just finished telling you over Zoom that the company is modernizing its strategy.
While half the company is converting the bonnets to NFTs (Nice Feline Toppings),
and the rest is working on a Clubhouse strategy, your team is adding
webhooks...