There is a client part on JS and server flask. Requests from the client go, come to the server. It does not go send a request back to the client.

<script type="text/javascript"> var xmlHttp = new XMLHttpRequest(); xmlHttp.open("post", "http://localhost:5000/"); xmlHttp.send('asdasd'); console.log(xmlHttp.responseText); </script> @app.route("/", methods=['GET', 'POST']) def GetDataFromClient(): data = request.data print(data) return "data" 

    0