RESTful API design - should a PUT return related data?

Posted by alexmcroberts on Programmers See other posts from Programmers or by alexmcroberts
Published on 2012-11-12T00:49:39Z Indexed on 2012/11/12 5:14 UTC
Read the original article Hit count: 284

Filed under:
|
|

I have an API which allows a user to update their system status; and a separate call to retrieve system status updates from other users. Would it make sense to unify them under a PUT request where a user would request a PUT update with their own status update, and they would receive the status updates of other users?

My solution would allow the PUT request to call the GET request method internally. The reason behind this is that when a user updates their system status they should be informed of other users status immediately, and I don't feel that having 2 seperate requests is necessary - and should be optional.

I intend to keep the GET request for other users status as a status update for a user is not necessarily required in order to retrieve other users status', but once they update their own status is it vital that they get information about other users.

© Programmers or respective owner

Related posts about web-applications

Related posts about api