Partial un-RESTful answer

During a discussion to develop our REST api, one of the development developers said that partial responses are not RESTful. for example, When returning a response to / forums / {forum_id} / users, I simply return the username and pic pic. When someone wants to get detailed information about the user, I send {age, location, points_scored, etc.}. When we tried to simulate this using ember data, we landed in the problem mentioned in https://github.com/emberjs/data/issues/51 When the developer indicated that the partial answers are contrary to the RESTful design. But I could not find such information in any of the REST books or on the Internet. Moreover, I found that Google actually uses partial responses in its RESTful API, and many of them use it.

Therefore, I would like to know that partial answers (for example, above) are really not recommended for RESTful services or just the problem of choosing a design.

+2
source share
1 answer

Contrary to popular belief, REST does not oblige you to read and write the exact same resources.

CouchDB is a really good example to exit. It processes:

  • "objects" (aka "documents") that can be created, read, updated and deleted,
  • and "views", which are calculated from documents that can only be read.

In your case it /forums/01a0/userswill be a "representation", but it /user/99a7will be an "object".

-1
source

All Articles