tree: 89d6d13d4666f01aa332153a09d396b640295918 [path history] [tgz]
  1. src/
  2. pom.xml
  3. README.MD
examples/clipboard/README.MD

Clipboard Example

Very basic resource example showcases CRUD functionality implemented via HTTP POST, GET, PUT and DELETE methods. A simple clipboard is simulated which is capable of handling text data only.

Contents

The mapping of the URI path space is presented in the following table:

URI pathResource classHTTP methods
/clipboardClipboardResourceGET
/clipboardClipboardResourcePOST
/clipboardClipboardResourcePUT
/clipboardClipboardResourceDELETE
/clipboard/historyClipboardResourceGET
/clipboard/historyClipboardResourceDELETE

Running the Example

Run the example as follows:

mvn clean compile exec:java

This deploys the Clipboard example using Grizzly

You can post a JSON entity:

curl -X POST http://localhost:8080/base/clipboard -H "Content-Type:application/json" -d '
{
   content: "The urgent task."
}'

or plain text entity:

curl -v -X POST http://localhost:8080/base/clipboard -H "Content-Type:text/plain" -d 'The urgent task'

After you successfully deploy the application and post entities, visit the following URLs: