Skip to content
Hendra Gunawan edited this page Apr 21, 2015 · 2 revisions

Create (POST)

status header: 201
content-type: application/json
accept: application/json
method: POST
URL: /model

By POST-ing JSON representation of the model, a new record will be inserted.

Read (GET)

status header: 200
content-type: application/json
method: GET
URL: /model/{id} or /model

By giving id as URL parameter, a JSON representing model with that id will be returned. If not, all records on model's table will be returned.

Update (PUT)

status header: 200
content-type: application/json
accept: application/json
method: PUT
URL: /model/{id}

By PUT-ing JSON representation of the model, the record with id will be updated and then returned as JSON.

Delete (DELETE)

status header: 202
content-type: text/plain
method: DELETE
URL: /model/{id}

By DELETE-ing, the record with id will be deleted.

Clone this wiki locally