Python bottle accept data send by jquery -
i'm using python bottle, html/css, , javascript develop website. in javascript part, want send list data end python using jquery:
$.ajax({ type: "post", url: '/deleteauthor', data: keys, success: function() { (var i=0, n=checkboxes.length; i<n; ++i) if (checkboxes[i].checked==true) { var id = "#" + checkboxes[i].value; $(id).hide(); } } }); in python bottle side, how can receive the data?
something like:
from bottle import route, run, request @route('/deleteauthor', method='post') def index(): request.body.seek(0) data = request.body.read() #do data run(host='localhost', port=8080, debug=true)
Comments
Post a Comment