私信  •  关注

Paul Gowder

Paul Gowder 最近创建的主题
Paul Gowder 最近回复了
5 年前
回复了 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。然后,可以将其记录下来,在一个视图函数中返回,无论它包含什么,您实际上都可以看到整个请求。