That didn’t help, but I’ve fixed the CORS issue by allowing requests from that origin on the server in question anyway.
Kind of digressing from the original question but if fetch does the job then I suppose it’s good enough!
That didn’t help, but I’ve fixed the CORS issue by allowing requests from that origin on the server in question anyway.
Kind of digressing from the original question but if fetch does the job then I suppose it’s good enough!
That didn’t help, but I’ve fixed the CORS issue by allowing requests from that origin on the server in question anyway.
Kind of digressing from the original question but if fetch does the job then I suppose it’s good enough!
@sdetweil said in What's the best way to fetch JSON data?:
@creepinjesus cors has nothing to do w fetch
No, that’s fair enough. Just checking it’s not the fetch method itself.
Is it possible then to even access JSON that’s being blocked by CORS using some other method? Would making the request from node_helper make a difference?
The data is being served on a local server and I can use curl or a browser to access it without issue; just not from a script in the browser (of course).
Hi all,
I’m hoping some of your developer knowledge can help me out here.
What is the best/recommended way to retrieve JSON (or other) data from external APIs? Up to now I’ve been using fetch()
in the main module .js file, but after hitting some CORS snags, I’m wondering if there is a better method?
Thanks.