Practice REST operations



http://apikothn.com



Request

GET /api/contacts HTTP/1.1

Host:apikothn.com

Cache-Control: no-cache

Content-Type: application/x-www-form-urlencoded

Response



Contact Preview
Contact ID Name Number Email Is Favourite

Resources and Actions


Resource HTTP Method Operation
/api/contacts GET Returns an array of contacts
/api/contacts POST Adds a new contact
/api/contacts,type=star GET Returns an array of favourite contacts
/api/contacts/:id GET Returns the contact with id of :id
/api/contacts/:id PUT Update the contact with id of :id
/api/contacts/:id DELETE Deletes the contact with id of :id
/api/contacts/:id/star PUT Adds to favourites the contact with id of :id
/api/contacts/:id/star DELETE Removes from favourites the contact with id of :id

Examples


Add new contact

To add new contact type /api/contacts at the input box. Select POST Method from dropdown. Fill the contact information as well as select true if you want to add the contact into your favourite list. Send Request and inspect the Request and Response returned. See the updates on preview.



Delete contact

To delete a contact type the resource URI with ID. If you want to delete a contact of ID:10 then URI will be /api/contacts/10. Select DELETE Method from dropdown. Send Request and inspect the Request and Response returned. See the updates on preview.