#has been blocked by CORS policy No 'Access-Control-Allow-Origin' header is present on the requested
17 messages · Page 1 of 1 (latest)
has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
let response_backend = await fetch(`mybackend`, { method: "GET"} ); let json_back = await response_backend.json();
https://www.npmjs.com/package/cors
You need you allow your front end specifically or set a proxy so the domains match
#❓javascript message This post explained it well
im genuinely confused
cuz this request works fine in python but not js from the same frontend
Is your python request running in the browser?
uh no
im using python for webserver/backend (specifically sanic) , html and js for the website
do i make my python server respond with the header Access-Control-Allow-Origin with the ip of my website or? im really confused
Im not really familiar with python servers but they likely have some sort of cors library. But yeah you need to either allow the ip of your website, or get the ips to be the same