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.
Alexandre Nucera edited this page Mar 19, 2015
·
6 revisions
Success
To return a response to the client, your method must return a django.http.HttpResponse. To facilitate its use, a method response in the class API have been created. You can send your data object to this method , and the return HTTP code that you want:
returnself.response(data, code=201)
Errors
For facilitate the error handling, you can raise an rest_api.errors.ResponseError whenever you need to return a response error.
Some custom ResponseError are already defined (ResponseNotFound, ResponseForbidden, ...). You could check out some examples in project.py.