A Flask extension for handling Cross Origin Resource Sharing (CORS), making cross-origin AJAX possible.
Questions tagged [flask-cors]
82 questions
0
votes
1 answer
How to fix: "Origin is not allowed by Access-Control-Allow-Origin." -- with flask_cors
I have set up a server with flask CORS and had it working for sending data to a React web app that I built, but when I went to test the POST method it stoped working and now it is broken for sending and receiving. The error log in the console of the…
![](../../users/profiles/5021056.webp)
kuck1
- 39
- 10
0
votes
2 answers
400 Bad Request error with flask server react client for socketio
Trying to create a socketio link between flask server and reactjs client. It shows this error
"Access to XMLHttpRequest at 'http://127.0.0.1:5000/socket.io/?EIO=3&transport=polling&t=MrcruFC' from origin 'http://localhost:3000' has been blocked by…
![](../../users/profiles/12057928.webp)
Gthu
- 27
- 5
0
votes
3 answers
Flask API deployed with Heroku 'CORS blocked' error
I'm having issues on my application that has been deployed to Heroku. When I was developing it on localhost, I didn't get this error, but once I deployed it, it spontaneously throws this error:
Access to fetch at
'https://frontend.herokuapp.com'…
![](../../users/profiles/11905841.webp)
Sean Kearney
- 29
- 4
0
votes
1 answer
flask-cors is not parsing the data from ajax client
I am using flask for creating some endpoints for a blockchain project . I need to accept json data from ajax client . Since it is cros platform , i am using flask cors . But i cant seem to find a solution. It is not working
I have already tried…
![](../../users/profiles/10225803.webp)
Aditya Nadig
- 174
- 1
- 9
0
votes
1 answer
I have a trouble with install flask_cors by pip
AJackTis-MacBook-Air:API ajackti$ pip install flask_cors
DEPRECATION: Python 2.7 will reach the end of its life on January 1st,
2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop…
![](../../users/profiles/8625861.webp)
AJackTi
- 63
- 1
- 6
0
votes
1 answer
Flask CORS: how could I receive an 'Authorization' header?
I have a front-end application on Vue.js and a back-end application on Flask/Python.
I'm trying to send to the back-end a request with an 'Authorization' header, however this header is not arriving on my back-end.
I've already tried to make…
![](../../users/profiles/8447990.webp)
rmmariano
- 618
- 10
- 23
0
votes
1 answer
Fetch request fails when I send POST request from React app to a Flask API
I'm pretty sure I've done everything correctly. Included 'Access-Control-Allow-Origin: *' in my response headers and everything.
I've browsed some other posts on StackOverflow and everything seems to be in line with all the suggestions there.…
![](../../users/profiles/7246326.webp)
Sara Kisch
- 11
- 3
0
votes
1 answer
flask-cors not sending preflight CORS request
I want to allow only localhost as access-control-allow-origin in my Flask app. I tried searching for this issue at other places with no solution. My code is very simple and straightforward as follows :
from flask import Flask
from routes.routes…
![](../../users/profiles/7870957.webp)
Shivansh Jagga
- 1,141
- 1
- 8
- 17
0
votes
2 answers
Making POST requests to Flask and getting back data
I have a React app that makes a POST request to a Flask backend. The POST request is designed to alter some data in a database and send back a calculated value. Everything seems to work on the Flask side except for the response. The response I get…
![](../../users/profiles/2771315.webp)
Black
- 3,680
- 7
- 29
- 49
0
votes
1 answer
Http to https redirect blocked by CORS policy
I am trying to do a GET (or POST) request to a localhost server from a chrome developer tools console window running on a website with https (in this case outlook.com, but it's the same for any https). If I run the same code from a website that is…
![](../../users/profiles/2208827.webp)
Sijmen
- 39
- 1
- 1
- 10
0
votes
2 answers
Request always returns 400 when sent from application (flask_corse)
I have a backend is implemented in flask and flask_restful and has a number of different routes. My frontend is running on another origin which means that I used flask_curse in order to allow my frontend to sent requests to my backend.
Bellow you…
![](../../users/profiles/4909727.webp)
TorbenVerdorben
- 149
- 10
0
votes
1 answer
Python Flask-cors not returning back any of the cors headers in response
I am using Flask-Cors==3.0.3
Here's the way I am setting it up for my app, where the front end is on localhost:9000 on apache while the backend is on localhost:8080:
app = Flask(_name_, template_folder="www/templates", static_folder…
![](../../users/profiles/980153.webp)
qre0ct
- 4,420
- 6
- 37
- 73
0
votes
1 answer
Flask API: How can I pass a param to url in angularjs $resource PUT method correctly?
I have the follow code, a factory that consumes an API rest:
angular.module('teachers')
.factory("TeachersService",
function($resource) {
var restPath = 'http://localhost:8001/entities/teacher/';
return $resource(restPath + ':id', {…
![](../../users/profiles/2903646.webp)
Juan Antonio
- 1,659
- 2
- 18
- 28
0
votes
1 answer
Flask CORS and Flask Limiter
I am using flask cors, flask limiter and AngularJS for my web-app.. Everything is working fine but what I want is too return a 429 too many request message on the front-end but I can't seem to do that because the OPTIONS methods blocks everything…
![](../../users/profiles/5568405.webp)
Dean Christian Armada
- 5,376
- 3
- 43
- 87
0
votes
1 answer
CORs request with flask api - Jquery POST request results in OPTIONs
I have a flask API to control an immersion heater device.
https://github.com/timcknowles/anovapi_backend/blob/master/anova.py
This is on my localhost server and it responds correctly to JQuery POST requests on the same domain e.g.…
![](../../users/profiles/2751156.webp)
TimK
- 89
- 1
- 8