0

In a Hypermedia capable REST API, consider a non browser client needs to access a resource Model-A. Typically we would have an entry point and then a ref to get models and then another ref to access the particular model.

But what if after checking the received model, we need to go back and check another model say Model-B ? In that case, wouldn't it be better to have a ref to the previous state ?

For an example, take an API for a toy store. First we would get a root link to list down all the toys.(May be a search with a criteria.) With the response, we would get a set of Toy representation with links to access them.

If I choose, say a train and then want to select something else, need to follow through from the start.

psaw.mora
  • 868
  • 1
  • 7
  • 18
  • Could you please provide an example for your question? –  Mar 01 '16 at 07:46
  • while navigating this REST API, you should be able to save the current URI in a variable, and then reuse it; and if that might sound contrary to a self-discoverable API, you can enhance the tool you're using to browse it (the "navigator") to also include a short navigation history, so you can do a "back" where applicable – Alexandru Marculescu May 26 '16 at 07:38

0 Answers0