I'm using Axios to make a simple GET request to a Shopify store for my client. Here is some of the code used to make the request.
const generateTaggedPosts = async (blog_posts, array) => {
await axios.get("{{shop.url}}/admin/api/2022-04/blogs/{{blog.id}}/articles.json", {
withCredentials: true,
AccessControlAllowOrigin: '*',
headers: {
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Credentials': true,
'Access-Control-Allow-Methods': 'GET, POST, OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type, Authorization'
}
})
I've tested this code before on a previous development store and it worked fine. However with this store I recieve a CORS error, stating that no 'Access-Control-Allow-Origin' header is present on the requested resource.
As you can see, I have included this in the header of the request so I'm a bit confused as to why this isn't working.
Any help is much appreciated!