简体   繁体   中英

No 'Access-Control-Allow-Origin' header is present on the requested resource. FLUTTER

I am using a third party https api and getting this error

has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I am using firebase hosting on spark plan with Cloudflare .

and the api is called from a subdomain like xyz.domain.com

Not a full answer.

Looks like it's something on the server side that need to be set. You can either disable CORS on your browser (which is sub-optimal as other users may face the same problem) or do the setting on the server side. I don't know Cloudflare, but I guess (?) there is some way that you can set 'Access-Control-Allow-Origin' to '*' , which would then fix it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM