API call results on same page using Flask
Hey guys! I managed to deploy a static page and run the script using Flask framework, but I have an issue that I can't seem to resolve, I'll be very grateful if you can help! I'd like to create a form and display the results of the api call in the same page and whitout reloading, I know I need to use ajax/js or jquery but to be frank I have no clue how to do that on Flask! App.py @app.route('/') def static_file(): return app.send_static_file('index.html') @app.route('/results/') def results(): headers = { 'X-ApiKey': 'xxxxxxxxxxxxxxxxxxxxx', } data = {'data': request.args.get('data')} results = requests.post('https://apiv2.indico.io/personality', headers=headers, data=data) return results.text HTML Form: <form action="/results"> <strong> Try It<br> <br> </strong><br> <input type="text" name="data"> <br><br> <input type="submit" value="Submit"> </form> Thank you so much!