You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 2, 2023. It is now read-only.
Maigret Aurélien edited this page Mar 17, 2015
·
6 revisions
Decorator get_data
This "decorator" used to retrieve automatically the data in the request, and send in the object data to the method. You can see an example in project.py.
Here, the POST fields "name" and "owner_id" are retrieved and added to a new object. If one of these doesn't exist in the request, an error is directly return to the client :
$> curl -X POST http://127.0.0.1:8000/api/1.0/project
{
"error": "You must provide all mandatory fields.",
"error_code": 400,
"error_details": [
"You must defined: 'name'",
"You must defined: 'owner_id'"
]
}