flask 中的 request

创建日期: 2023-02-04 18:37 | 作者: 风波 | 浏览次数: 16 | 分类: Flask

1. 获取 request 数据

来源:https://stackoverflow.com/questions/10434599/get-the-data-received-in-a-flask-request

The docs describe the attributes available on the request object (from flask import request) during a request. In most common cases request.data will be empty because it's used as a fallback:

request.data Contains the incoming request data as string in case it came with a mimetype Flask does not handle.

All of these are MultiDict instances (except for json). You can access values using:

2. request 中的字段

来源:https://flask.palletsprojects.com/en/2.2.x/api/#flask.Request.json

很多……

16 浏览
0 评论