21 lines
583 B
Python
21 lines
583 B
Python
|
|
class MandayeResponse(object):
|
|
""" Mandaye HTTP Response
|
|
"""
|
|
|
|
def __init__(self, code, status, headers, content):
|
|
"""
|
|
code: integer return code (200, 302, 404, ..)
|
|
status: string with http status (ex: OK, Not Found, ...)
|
|
headers: an array with the headers
|
|
content: the string with a response content
|
|
"""
|
|
self.code = code
|
|
self.status = status
|
|
self.headers = headers
|
|
self.content = content
|
|
|
|
|
|
_404 = MandayeResponse(404, 'Not found', [], '')
|
|
_502 = MandayeResponse(502, 'Bad Gateway', [], '')
|