tornado-openapi3/tornado_openapi3/responses.py
2024-10-20 22:40:05 -04:00

13 lines
427 B
Python

from tornado.httpclient import HTTPResponse
from werkzeug.datastructures import Headers
class TornadoOpenAPIResponse:
def __init__(self, response: HTTPResponse) -> None:
self.status_code = response.code
self.headers = Headers(response.headers.get_all())
self.content_type = response.headers.get("Content-Type", "text/html")
self.data = response.body
__all__ = ["TornadoOpenAPIResponse"]