ブラウザー側から配列をもらいたい
##.ajax()
bad request 400
と苦戦した結果
JavaScript側
$("#finish").on('click',function(){
$.ajax({
url:"/finish",
type:"POST",
data:JSON.stringify(arrObj(action)),
contentType: "application/json; charset=utf-8",
dataType: "json",
traditional: true,
success:function(){
console.log(sent);
},
error:function(){
console.log(err);
}
})
});
Python側
@app.route('/finish',methods=['POST'])
def getData():
if request.method == 'POST':
data = request.get_json(force=True)
print(data)
return render_template("result.html")