📜  python 处理 post 请求 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:06.994000             🧑  作者: Mango

代码示例1
# first do: pip install flask

from flask import Flask, request

app = Flask(__name__)

@app.route('/', methods=['POST'])
def result():
    print(request.data)  # raw data
    print(request.json)  # json (if content-type of application/json is sent with the request)
    print(request.get_json(force=True))  # json (if content-type of application/json is not sent)