View example21.sh
curl http://localhost:3000/friends/2/relationships/loans -X PATCH \
-H 'Content-Type: application/vnd.api+json' \
--data-binary '{"data":[{"id":"2", "type":"loans"}]}' -i
View example20.sh
curl http://localhost:3000/loans -X POST \
-H 'Content-Type: application/vnd.api+json' \
--data-binary '{"data":{"type": "loans","attributes": {"notes": "Minor issue with the throttle","returned": false},"relationships":{"article": {"data":{"type": "articles", "id": "2"}}}}}'
View example19.sh
curl http://localhost:3000/articles -X POST \
-H 'Content-Type: application/vnd.api+json' \
--data-binary '{"data":{"type":"articles","attributes":{"name": "Honda CRF450R","available":"true"}}}'
View example18.sh
curl http://localhost:3000/friends/2/relationships/loans -X PATCH \
-H 'Content-Type: application/vnd.api+json' \
--data-binary '{"data":[]}' -i
View example17.sh
curl http://localhost:3000/friends/2/relationships/loans -X PATCH \
-H 'Content-Type: application/vnd.api+json' \
--data-binary '{"data":[]}' | jq
View exaple16.sh
curl http://localhost:3000/friends/2/relationships/loans -X POST \
-H 'Content-Type: application/vnd.api+json' \
--data-binary '{"data":[{"id":"1", "type":"loans"}]}' -i
View example15.sh
curl http://localhost:3000/friends/2/relationships/loans -X POST \
-H 'Content-Type: application/vnd.api+json' \
--data-binary '{"data":[{"id":"3", "type":"friends"}]}'
View example14.sh
curl http://localhost:3000/loans/1/relationships/friend -X PATCH \
-H 'Content-Type: application/vnd.api+json' \
--data-binary '{"data":null}' -i
View example13.sh
curl http://localhost:3000/loans -X POST \
-H 'Content-Type: application/vnd.api+json' \
--data-binary '{"data":{"type":"loans","attributes":{}}}' | jq
View example12.sh
curl http://localhost:3000/loans -X POST \
-H 'Content-Type: application/vnd.api+json' \
--data-binary '{"data":{"type": "loans","attributes": {"notes": "minor scratches in the face shield","returned": false},"relationships":{"friend": {"data":{"id":"2","type": "friends"}},"article": {"data":{"id":"1","type": "articles"}}}}}' | jq