【发布时间】:2023-04-03 06:07:01
【问题描述】:
我想将数组传递给 Python Flask,但结果为空或 b'undefined=&undefined=&undefined='。这是我的代码 Javascript
var test = [1, 2, 3];
$.ajax({
url: '/table',
data : test,
type: 'POST',
success: function(response) {
console.log(response);
},
error: function(error) {
console.log(error);
}
});
和 Python 代码
app.route('/table', methods = ['POST'])
def table():
#print(request.values)
print(request.get_data())
return 'got this'
【问题讨论】: