The Firefox REST Client addon is an excellent option when you need to quickly perform a single validation. It is really EASY to use...
Good introduction to RESTful Web Services: http://www.ibm.com/developerworks/webservices/library/ws-restful/
GET Method:
The basic GET operation is very simple. It essentially is URL, Authentication, and Method.
In my example, I would like to test the API regarding DMA-managed MCUs.
The GET method, in my case, is https://[DMA_hostname]:8443/api/rest/mcus
The "Response Body (Highlight)" section is a neatly formatted xml formed from the response body. This may be blank if there was a failure in the request or there is no expected data to be returned, beyond the header information. That's very useful to prepare your parsing method.
POST Method:
You can also set the "Body" to use POST method, like add an user, schedule a conference...
Setting the body can be a little tricky as you need to be sure you have all the required elements, but also very useful and quicker that doing that in your final code...
You can also imagine to use CURL. CURL – “Client for URLs” – is a CLI based tool that will allow you to execute RESTful commands. A tutorial about CURL: http://www.redmine.org/projects/redmine/wiki/Rest_api_with_curl
No comments:
Post a Comment