This sample projects shows how to do simple RESTful content negotiation with the Play! framework.
The User-Sample application can be used to create, read, update and delete users. It offers HTML, JSON and XML output and can be used to both upload and download arbitrary files such as images.
The API can be accessed as follows (see routes file ):
- Read all users: GET /
- Read single user: GET /user/id/
- Create new user: POST /user/ with data as payload
- Update single user: PUT /user/id/ with new data as payload
- Delete single user: DELETE /user/id/
Depending on the clients Accept header either a HTML, XML or JSON representation will be send back.