REST: how to handle an action modifying multiple resources

I am trying to understand the RESTful resource architecture. I understand that HTTP GET /accountswill not list accounts, and GET /accounts/123will not provide information about this account. How to implement active management in the RESTful architecture, for example, transfer money from account A to account B?

+4
source share
1 answer

Consider declaring the transaction itself as a resource so that you can work on one resource atomically:

POST /transaction

-> /transaction/456

I suggest avoiding HTTP PUTin this case, because idempotency is not what we want for this resource.

A B.

+6

All Articles