17. The APIs
HTTP Method URI Endpoint Action
GET /todo/api/v1.0/tasks tasks Retrieve list of tasks
POST /todo/api/v1.0/tasks tasks Create a new task
GET /todo/api/v1.0/tasks/[task_id] task Retrieve a task
PUT /todo/api/v1.0/tasks/[task_id] task Update an existing task
DELETE /todo/api/v1.0/tasks/[task_id] task Delete a task
17 / 20
18. Notes
Marshalling
RequestParser: define the arguments and how to
validate them.
A side benefit of letting Flask-RESTful do the validation is
that now there is no need to have a handler for the bad
request code 400 error, this is all taken care of by the
extension.
Example #1
18 / 20