You can get the results with a simple:
@app.route('your route', methods=['GET'])
def yourMethod(params):
response = flask.jsonify({'some': 'data'})
response.headers.add('Access-Control-Allow-Origin', '*')
return response
More Related Contents:
- Javascript – No ‘Access-Control-Allow-Origin’ header is present on the requested resource
- CORS error on same domain?
- Get data from html and and pass the data back to the front end using ajax or js
- Python Flask Cors Issue
- Origin is not allowed by Access-Control-Allow-Origin
- JavaScript raises SyntaxError with data rendered in Jinja template
- Can scrapy be used to scrape dynamic content from websites that are using AJAX?
- Display data streamed from a Flask view as it updates
- Response to preflight request doesn’t pass access control check
- jQuery XML error ‘ No ‘Access-Control-Allow-Origin’ header is present on the requested resource.’
- how to bypass Access-Control-Allow-Origin?
- No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘…’ is therefore not allowed access
- How can I pass data from Flask to JavaScript in a template?
- Why am I seeing an “origin is not allowed by Access-Control-Allow-Origin” error here? [duplicate]
- Origin is not allowed by Access-Control-Allow-Origin
- Understanding AJAX CORS and security considerations
- Pass parameter with Python Flask in external Javascript
- Rendering to JS with Jinja produces invalid number rather than string
- Pass JavaScript variable to Flask url_for
- Display the contents of a log file as it is updated
- Cross Domain Resource Sharing GET: ‘refused to get unsafe header “etag”‘ from Response
- What’s to stop malicious code from spoofing the “Origin” header to exploit CORS?
- How to allow CORS in react.js?
- Cross-origin resource sharing (CORS) concept
- CORS error for application running from file:// scheme
- How to Detect Cross Origin (CORS) Error vs. Other Types of Errors for XMLHttpRequest() in Javascript
- How can I pass parameter through serialization and then parse them using external JavaScript?
- Flask Dynamic data update without reload page
- CORS error with jquery
- Passing variables from Flask to JavaScript