flask-restless

Why does my JavaScript code get a “No 'Access-Control-Allow-Origin' header is present on the requested resource” error when Postman does not?

筅森魡賤 提交于 2019-11-25 22:09:27
问题 I am trying to do authorization using JavaScript by connecting to the RESTful API built in Flask. However, when I make the request, I get the following error: XMLHttpRequest cannot load http://myApiUrl/login. No \'Access-Control-Allow-Origin\' header is present on the requested resource. Origin \'null\' is therefore not allowed access. I know that the API or remote resource must set the header, but why did it work when I made the request via the Chrome extension Postman? This is the request