Topher1
02-16-2021
01:40 PM
Thread Options
- Subscribe to RSS Feed
- Mark Thread as New
- Mark Thread as Read
- Float this Thread for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
React JS (Javascript) blocked by CORS
I don't have access to my client's account so I'm not sure if you can manipulate the CORS from the dashboard/server, but my React application is trying to connect to the API and getting the following message:
Access to XMLHttpRequest at 'https://api.weebly.com/v1/user/sites/[STORE_NUMBER]/store/products' from origin 'http://localhost:8000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Here is the Javascript
axios.get('https://api.weebly.com/v1/user/sites/[STORE_NUMBER]/store/products', {
headers: {
'accept': 'application/vnd.weebly.v1+json',
'content-type': 'application/json',
'x-weebly-access-token': '[TOKEN]',
},
})
.then((response) => {
console.log(response);
})
Reply
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report
1 REPLY 1
adt4ed
09-27-2021
10:04 PM
Thread Options
- Subscribe to RSS Feed
- Mark Thread as New
- Mark Thread as Read
- Float this Thread for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Were you able to fix it?
Reply
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report