I run the Flask-Restful API locally and send a POST request containing JSON from another port. I get an error
No 'Access-Control-Allow-Origin' header is present on the requested resource.
However, when I run
curl
I get
HTTP/1.0 200 OK
Content-Type: text/html; charset=utf-8
Allow: HEAD, GET, POST, OPTIONS
Access-Control-Allow-Origin: http://localhost:8080
Access-Control-Allow-Methods: DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT
Vary: Origin
Access-Control-Allow-Headers: Content-Type
Content-Length: 0
which shows "Access-Control-Allow-Origin" as "*". GET is working fine, it's just a POST that gives this error. What could go wrong? If necessary, for the interface I use reaction and query through axioms.
source
share