From e1b6f496861e92e183cf16b081e0ef95f149b87e Mon Sep 17 00:00:00 2001 From: aranzaiger Date: Thu, 11 Jun 2015 20:59:40 +0300 Subject: [PATCH] added response utils --- SE_API/Respones_Utils.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 SE_API/Respones_Utils.py diff --git a/SE_API/Respones_Utils.py b/SE_API/Respones_Utils.py new file mode 100644 index 0000000..a7d7b17 --- /dev/null +++ b/SE_API/Respones_Utils.py @@ -0,0 +1,15 @@ +__author__ = 'Aran' + +from flask import Response +import json + +def bad_request(): + return Response(response=json.dumps({'message': 'Bad Request'}), + status=400, + mimetype="application/json") + + +def forbidden(message={'message': 'Forbidden'}): + return Response(response=json.dumps(message), + status=403, + mimetype="application/json") \ No newline at end of file