I have been stuck for a while with the CORS issue. I have been checking numerous documentation and I still can't fix this issue and I am not sure what I am missing. I think this is a classic fetch:
fetch('http://192.168.1.1/osc/commands/execute', {
  method:'POST',
  headers:{
    'Content-Type': 'application/json',
    'Access-Control-Allow-Origin':'*' ,
    'X-Requested-With':'xmlhttprequest'
  },
  mode:'cors',
  body:JSON.stringify({
    name: 'camera.startSession',
    parameters: {}
  })
 })
 .then(response => response.json())
 .then(console.log)
}but I still have this error: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://192.168.1.1/osc/commands/execute. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). This is followed by : Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://192.168.1.1/osc/commands/execute. (Reason: CORS request did not succeed) Is that supposed the headers 'Access-Control-Allow-Origin':''* was supposed to fix this issue? I have been successfully testing this request with Talend API Tester on chrome, but the option copy as fetch still response with the same errors...
Thank you for your assistance. Cheers.
 
    