Not able to use axios library from retool

I have this sample query


When I run this, it shows me error on console.

Basically. I'm not able to call any API from the axios. I can definately make a API resource query and use it. but that doesn't matches with my use-cases and gives me some logical error while execution.

Is there is any way to solve it?

Hey @flintrider! Does this work for a non-Google URL (e.g. Wikipedia)?

Yes. It shows the same error with wikipedia or any URL that I use.

It seems like you are currently running an XMLHttpRequest to a different domain than your current page and the browser is blocking it as it only allows a request in the same origin for security reasons. Cross-domain requests require different permissions and Retool is run in a sandbox, so I'm not sure if this is possible. It may be, I just haven't been able to get it to work myself either. :pensive:

In the meantime, is there a way we could use a REST API query instead of axios? :slight_smile:

Thanks for your info.