-
Notifications
You must be signed in to change notification settings - Fork 4
Response Library
Trevor Geene edited this page Jan 4, 2021
·
2 revisions
THIS PAGE IS CURRENTLY OUT OF DATE
Call Library: from application.libraries.response import response
Function | Example |
---|---|
General Response | response.respond(data={}, status=200, message='') |
Resource Created (201) | response.respond_created(data={}, message='') |
Resource Deleted (200) | response.respond_deleted(data={}, message='') |
Nothing to Display (204) | response.respond_no_content(message='') |
General Fail | response.fail(message='', status=400, messages={}) |
Unauthorized (401) | response.fail_unauthorized(message='') |
Forbidden (403) | response.fail_forbidden(message='') |
Not Found (404) | response.fail_not_found(message='') |
Resouce Exists (409) | response.fail_resource_exists(message='') |
Resouse Gone (410) | response.fail_resource_gone(message='') |
All functions return JSON creates using jsonify
.