Source code for jivago.wsgi.request.response

from typing import Union

from jivago.wsgi.request.headers import Headers


[docs] class Response(object): def __init__(self, status: int, headers: Union[dict, Headers], body): self.status = status self.headers = Headers(headers) if isinstance(headers, dict) else headers self.body = body
[docs] def copy(self, response: "Response"): # For using the response as an output parameter self.status = response.status self.headers = response.headers self.body = response.body
[docs] @staticmethod def empty(): return Response(200, {}, "")