社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
Py学习  »  Paul Gowder  »  全部回复
回复总数  1
6 年前
回复了 Paul Gowder 创建的主题 » 使用python flask读取多个文件[重复]

这是一种获取所有请求数据的恶意黑客,不管它是如何发送的,但我认真地使用了:

def get_request_info():
    args = str(request.args)
    form = str(request.form)
    files = str(request.files)
    maybe_json = request.get_json(silent=True, cache=False)
    if maybe_json:
        thejson = json.dumps(maybe_json)
    else:
        thejson = "no json"
    return # whatever you want 

然后我返回一个连接这些命令的字符串,或者,如果我觉得有必要,我跳过字符串调用/json dump并合并所有的dict。然后,可以将其记录下来,在一个视图函数中返回,无论它包含什么,您实际上都可以看到整个请求。