Answers for "set the request's mode to 'no-cors' api fetch"

-1

fetch request allow cors

// From http://foo.com/
fetch('http://bar.com/data.json', { 
    mode: 'no-cors' // 'cors' by default
}).then(function(response) {
    // Do something with response
});
Posted by: Guest on June-25-2021
0

how to set the request's mode to 'no-cors' javascript

const url = 'https://www. yammer.com/api/v1/messages/following.json';

const options = {
  method: 'GET',
  mode: 'no-cors',
  headers: {
    'Authorization': `Bearer ${process.env.REACT_APP_YAMMER_ACCESS_TOKEN}`,
  }
};

fetch(url, options).then(function(response) {
  console.log(response);
  return response.json();
}).then(function(json) {
  console.log(json);
});
Posted by: Guest on August-19-2021

Code answers related to "set the request's mode to 'no-cors' api fetch"

Code answers related to "Javascript"

Browse Popular Code Answers by Language