Issues with API

I’ve been trying to make an API request with NASA POWER but I seem to get issues with CORS. I’m not too sure about how to fix this. The API request returns what is expected in the browser url bar but not on App Gyver. I’ve attached photos
Thanks


Hi,

Unfortunately Composer throws the CORS issue as default if something goes wrong with the request, it might be a CORS issue or it might not. If you open the developer tools with Ctrl + Shift + I or Cmd + Shift + I and then click on run test, you should see the request in the list. Do you see any error with it? Or does it respond with 200 success code or maybe some 400/500 error code?

Hi,
It responds with these errors, guessing it is a CORS issue?
Screenshot 2021-11-05 12.29.39

Yes seems so unfortunately :confused: Another test to confirm if you want to try, is to use the preview app and check if the request comes through on your mobile device. If it works on mobile, but not on web, then it’s definitely a CORS issue and there’s nothing on the Composer side to do about it.

One option is to use a custom backend as a middle piece between NASA POWER and Composer. That would entail calling NASA POWER in your backend, and then requesting your backend on the composer side.

I’ve managed to use a CORS proxy which seemed to do the trick, slower unfortunately though.