Answers for "how to send information from javascript to flask route"

2

how to send information from javascript to flask route

#python route
@app.route('/this-route', methods=['GET', 'POST']):
def thisRoute():
    information = request.data
    return "1"

#javascript
const URL = '/get-coordinates'
const xhr = new XMLHttpRequest();
sender = JSON.stringify([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
xhr.open('POST', URL);
xhr.send(sender);
Posted by: Guest on August-30-2020

Code answers related to "how to send information from javascript to flask route"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language