Dashboard > GreenPepperOpen > ... > Developer Examples > RestFixture > Information > Page Comparison
  GreenPepperOpen Log In View a printable version of the current page.  
  RestFixture
compared with
Current by Francois Denommee
on Jul 08, 2010 08:12.

 
Key
These lines were removed. This word was removed.
These lines were added. This word was added.

View page history


There are 0 changes. View first change.

 {greenpepper-import:com.greenpepper.extensions}
  
 ||do with | Rest Fixture || on | http://localhost:9998 |
  
 h3. GET example
  
 {quote}
 || GET | /helloworld |
 ||check | response status | 200 |
 ||check | response header || Content-Type | text/plain |
 ||check | response body | Hello World |
 {quote}
  
 {quote}
 || GET | /unknown|
 ||check | response status | 404 |
 {quote}
  
 h3. POST example (create resource)
 {quote}
 ||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 |
 {quote}
  
 h3. Request with custom header example
 {quote}
 || set request header |Accept|| as | application/xml|
  
 ||GET | /messages/0|
 ||check | response status | 200 |
 ||check | response body | {code:xml}<?xml version="1.0"><message id="0" value="Hello GreenPepper" />{code}
 {quote}
  
 h3. PUT example (update resource)
 {quote}
 ||set request body| Hello from GreenPepper |
  
 ||PUT | /messages/0|
 ||check | response status | 200 |
  
 ||GET | /messages/0|
 ||check | response body | Hello from GreenPepper |
 {quote}
  
 h3. HEAD example (check if specified resource exists)
 {quote}
 ||HEAD | /messages/0|
 ||check | response status | 200 |
  
 ||HEAD | /messages/1|
 ||check | response status | 404 |
 {quote}
  
 h3. DELETE example
 {quote}
 ||DELETE| /messages/0|
 ||check | response status | 200 |
  
 ||GET | /messages/0|
 ||check | response status | 404 |
 {quote}
  
 ||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