mirror of
https://github.com/correl/tornado-openapi3.git
synced 2024-11-24 11:09:57 +00:00
13 lines
427 B
Python
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"]
|