Simple Play! project showing content negotiation with HTML/XML & JSON
Java
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
conf
public/images
.gitignore
README.textile

README.textile

Play! User Example

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.

API

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.