Aug 22, 2024
Resource Structure:
/api/{user}
where {user}
is the user's name.text
.Operations for a Specific To-Do Item:
Creating a To-Do Item (POST):
curl -H "Content-Type: application/json" -X POST -d '{"text": "my thing to do"}' http://localhost/api/adam
Retrieving All To-Do Items (GET):
curl -H "Content-Type: application/json" -X GET http://localhost/api/adam
Updating a To-Do Item (PUT):
curl -H "Content-Type: application/json" -X PUT -d '{"completed": true}' http://localhost/api/adam/15
Retrieving a Specific To-Do Item (GET):
curl -H "Content-Type: application/json" -X GET http://localhost/api/adam/15
Deleting a To-Do Item (DELETE):
curl -H "Content-Type: application/json" -X DELETE http://localhost/api/adam/15