'getting a lot of errors from a request and i am not good at requests [duplicate]

When I request something it comes up with 3 errors.

I think it doesn't allow me to do a request from specific places but I am not sure I am pretty new to requests and I want to put this in my content script. the 3 errors

I tried doing it on other places but it didn't work, I expected to get a JSON response back.

And also if I just go to the link it gives me the info I need, if the only way to do it is through background page in my web extension then that's fine but I prefer it on the content script.



Solution 1:[1]

It is a CORS error that is Cross-Origin Resource Sharing, that means you are requesting a url which has only allowed a certain other URLs to consume its resources. Try adding Moesif Cors extension to google chrome and then request the API, this extension bypass the CORS policy. If it doesn't, that means you cannot hit that API, outside access to resource is restricted.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ritik Banger