Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Let's revisit the GET /orders/1234 API again. It was previously suggested that the resource might include a link to cancel the order. In order for HATEOAS to work as intended, the server needed to verify that order #1234 was capable of being cancelled. This could rely on a number of factors, such as permissions of the user, whether the product was already shipped, or terms and conditions of this order. In any caseall cases, the server makes a determination and returns or withhold withholds the link (hypermedia) that informs the client that this order may be cancelled. Furthermore, the client must use this link to request a state change (i.e., cancel the order)order cancellation link as needed.