Dashboard > GreenPepperOpen > ... > Developer Examples > RestFixture
  GreenPepperOpen Log In View a printable version of the current page.  
  RestFixture
Added by Laurent Cobos, last edited by Francois Denommee on May 12, 2009  (view change)
Labels: 
(None)

Import
com.greenpepper.extensions
do with Rest Fixture on http://localhost:9998

GET example

GET /helloworld
check response status 200
check response header Content-Type text/plain
check response body Hello World
GET /unknown
check response status 404

POST example (create resource)

set request body Hello GreenPepper
POST /messages
check response status 201
check response header Location http://localhost:9998/messages/0
GET /messages/0
check response status 200
check response body Hello GreenPepper

Request with custom header example

set request header Accept as application/xml
GET /messages/0
check response status 200
check response body
<?xml version="1.0"><message id="0" value="Hello GreenPepper" />

PUT example (update resource)

set request body Hello from GreenPepper
PUT /messages/0
check response status 200
GET /messages/0
check response body Hello from GreenPepper

HEAD example (check if specified resource exists)

HEAD /messages/0
check response status 200
HEAD /messages/1
check response status 404

DELETE example

DELETE /messages/0
check response status 200
GET /messages/0
check response status 404
end
DEMONSTRATION LICENSE - This Confluence site is for demonstration purposes only. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.4.3 Build:#705 Mar 21, 2007) - Bug/feature request - Contact Administrators