1/* You can create a node.js web server and use Fetch/AJAX POST requests to send
2data.
3*/
4/* Python Route Code */
5@app.route('/postmethod', methods = ['POST'])
6def get_post_javascript_data():
7 jsdata = request.form['javascript_data']
8 return json.loads(jsdata)[0]
9/* Javascript Send Data */
10fetch('Yourdomain.com/postmethod', {
11 method: 'POST',
12 headers: { 'Content-Type': 'application/json' },
13 body: JSON.stringify({
14 'foo': 'bar'
15 }),
16})
17 .then((res) => res.json())
18 .then((data) => {
19 // Do some stuff ...
20 })