Answers for "access to fetch blocked by cors policy"

-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

origin 'http://localhost:4200' has been blocked by CORS policy

let headers = new HttpHeaders({
      'Content-Type': 'application/json',
      'Access-Control-Allow-Origin': '*',
      'Access-Control-Allow-Headers': 'Content-Type',
      'Access-Control-Allow-Methods': 'GET,POST,OPTIONS,DELETE,PUT',
      'Authorization': 'Bearer szdp79a2kz4wh4frjzuqu4sz6qeth8m3',
    });
Posted by: Guest on November-27-2020

Code answers related to "access to fetch blocked by cors policy"

Code answers related to "Javascript"

Browse Popular Code Answers by Language