这对我有用。
用Javascript:
$.ajax({ type: 'POST', url: "enter your correct url", contentType: "application/json; charset=utf-8", data: JSON.stringify({title: 'My Title', article: 'My article'}), success: function(result){ console.log(result) }});在Python中(烧瓶):
from flask import request import json @app.route("/", methods=['POST']) def home(): json_data = json.loads(request.data) print(json_data) return json_data注意:要点是;
- JSON.stringify()
- contentType:“应用程序/ json; charset = utf-8”
- json.loads
- 请求数据



