REST API - What should my post return?
Here is a short description of what I am trying to do
- Build a set of APIs for an online game.
- my GET API I want to return all open games (list of games) GET / api / games /
- my POST API I want to create a new game POST / api / games /
My question is how to get my POST API back. Ideally I would like the client to know the gameId of the newly created game, so that all game specific operations can then use the following syntax / api / games / gameId
Any suggestions how can I transfer this game back to the client?
source to share