A simple example of a REST API with Jersey on an embedded Tomcat
Run rest.Application
to start a server on http://localhost:8080/api/v1
There is only one resource provided at /examples
for demonstration purposes
Returns a JSON array of Examples
Returns a single JSON Example by its id
Updates a single JSON Example by its id. Requires an Example JSON in request body as follows:
{"id":"4","title":"Example 4"}
Deletes an Example by id
Creates a new JSON Example. Requires an Example JSON in request body as follows:
{"id":"4","title":"Example 4"}