diff options
Diffstat (limited to 'src/ogRest.py')
-rw-r--r-- | src/ogRest.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ogRest.py b/src/ogRest.py new file mode 100644 index 0000000..dfc382c --- /dev/null +++ b/src/ogRest.py @@ -0,0 +1,14 @@ +from enum import Enum + +class ogResponses(Enum): + BAD_REQUEST=0 + IN_PROGRESS=1 + OK=2 + +def getResponse(response): + if response == ogResponses.BAD_REQUEST: + return 'HTTP/1.0 400 Bad request\r\n\r\n' + if response == ogResponses.IN_PROGRESS: + return 'HTTP/1.0 202 Accepted\r\n\r\n' + if response == ogResponses.OK: + return 'HTTP/1.0 200 OK\r\n\r\n' |