API Design · Senior · Question 41 of 75
Why might an API use resource-oriented 'custom methods' like POST /orders/42:cancel?
- ✓Correct answer: Some operations don't fit CRUD; a named method keeps the resource model while making business actions explicit and auditable
- 2Colons are required in REST
- 3To avoid using HTTP methods
Explanation
Google's AIP-136 describes custom methods; other guides use sub-resources like /orders/42/cancellation.