I need to send data through XmlHttpRequest from JavaScript to Python server. Because I\'m using localhost, I need to use CORS. I\'m using the Flask framework an
XmlHttpRequest
I have used the flask-cors extension.
Install using pip install flask-cors
pip install flask-cors
Then it's simply
from flask_cors import CORS app = Flask(__name__) CORS(app)
This will allow all domains