From db840656a43a7d0f7224a70ed56b619884a1df85 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 31 Jul 2018 16:25:05 +0300 Subject: Add: not found response --- qvisqve/__init__.py | 1 + qvisqve/responses.py | 6 ++++++ 2 files changed, 7 insertions(+) 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', -- cgit v1.2.1