I am getting CORS error on localhost during post request call. below is the code
fetch('http://sandbox.mywebsite.com/api//product-list/', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Access-Control-Allow-Origin': '*',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"category_id":1
})
})
Same giving proper response when testing on https://inspector.swagger.io/builder .
Any help will be appreciated