Answers for "access-to-xmlhttprequest-has-been-blocked-by-cors-policy"

0

access-to-xmlhttprequest-has-been-blocked-by-cors-policy

app.use(function (req, res, next) {
    //Enabling CORS
    res.header("Access-Control-Allow-Origin", "*");
    res.header("Access-Control-Allow-Methods", "GET,HEAD,OPTIONS,POST,PUT");
    res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, 
    Accept, x-client-key, x-client-token, x-client-secret, Authorization");
      next();
    });
Posted by: Guest on October-28-2021
0

access-to-xmlhttprequest-has-been-blocked-by-cors-policy

app.use(function (request, response, next) {
  response.header("Access-Control-Allow-Origin", "*");
  response.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
  next();
});
Posted by: Guest on October-28-2021

Code answers related to "access-to-xmlhttprequest-has-been-blocked-by-cors-policy"

Browse Popular Code Answers by Language