Answers for "how to set request mode to no-cors"

1

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
19

fetch api javascript

fetch('http://example.com/movies.json')
  .then((response) => {
    return response.json();
  })
  .then((myJson) => {
    console.log(myJson);
  });
Posted by: Guest on February-10-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language