[[extend "layout.html"]]

Rest examples

Your authentication token is [[=token]]. Reload the page for a new token.

List all chairs

    curl -H "Authentication: [[=token]]" \
         [[=URL('rest/chair', scheme=True)]]

Create a new chair record

    curl -X POST \
         -d '{"color":"red"}' \
         -H "Content-Type: application/json" \
         -H "Authentication: [[=token]]" \
         [[=URL('rest/chair', scheme=True)]]

Retrieve chair with id=1

    curl -H "Authentication: [[=token]]" \
         [[=URL('rest/chair/1', scheme=True)]]

Update chair with id=1

    curl -X PUT \
         -d '{"color":"green"}' \
         -H "Content-Type: application/json" \
         -H "Authentication: [[=token]]" \
         [[=URL('rest/chair/1', scheme=True)]]

Delete chair with id=1

    curl -X DELETE \
         -H "Authentication: [[=token]]" \
         [[=URL('rest/chair/1', scheme=True)]]