diff options
author | Lars Wirzenius <liw@liw.fi> | 2018-07-31 16:25:05 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2018-07-31 16:25:05 +0300 |
commit | db840656a43a7d0f7224a70ed56b619884a1df85 (patch) | |
tree | 52de565e70bb5353131969f4379352cf1724677a | |
parent | efb3a40d113b8fbb20946d635f417750f1be68b7 (diff) | |
download | qvisqve-db840656a43a7d0f7224a70ed56b619884a1df85.tar.gz |
Add: not found response
-rw-r--r-- | qvisqve/__init__.py | 1 | ||||
-rw-r--r-- | qvisqve/responses.py | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/qvisqve/__init__.py b/qvisqve/__init__.py index 7d2b68f..ec7a48c 100644 --- a/qvisqve/__init__.py +++ b/qvisqve/__init__.py @@ -37,6 +37,7 @@ from .responses import ( bad_request_response, created_response, ok_response, + not_found_response, unauthorized_response, found_response, ) diff --git a/qvisqve/responses.py b/qvisqve/responses.py index d36094e..cd9a89f 100644 --- a/qvisqve/responses.py +++ b/qvisqve/responses.py @@ -37,6 +37,12 @@ def ok_response(body, headers=None): return response(apifw.HTTP_OK, body, headers) +def not_found_response(): + body = 'Not Found\n' + headers = {} + return response(apifw.HTTP_NOT_FOUND, body, headers) + + def created_response(body, location): headers = { 'Content-Type': 'application/json', |