【发布时间】:2020-06-09 14:51:07
【问题描述】:
我是龙卷风的新手。目前我想从帖子 request_body 中阅读。但是 post 请求中的数据很大,所以我想通过 Tornado 中的 stream_body_request 来实现它。但我无法实现它。如何分块读取这个“img_data”?
@stream_request_body
class MyReportPDF(BaseHandler):
async def post(self):
data = escape.json_decode(self.get_body_argument('img_data'))#This data is an base_64_array
for i in range(len(data)):
# Clean the base_64 Image
data[i].replace('data:image/jpeg;base64,', '')
decode_image.append(base64.b64decode(data[i]))
【问题讨论】:
标签: python-3.x request tornado chunks