Request header field is not allowed by Access-Control-Allow-Headers with $http

后端 未结 3 1475
广开言路
广开言路 2021-01-03 01:15

I\'m doing a POST to a service using Postman Chrome Extension, and I get the expected response.

But, when I do the same POST reque

3条回答
  •  心在旅途
    2021-01-03 02:14

    if use sails api on backend change cors.js and add your token filed here

    module.exports.cors = {
      allRoutes: true,
      origin: '*',
      credentials: true,
      methods: 'GET, POST, PUT, DELETE, OPTIONS, HEAD',
      headers: 'Origin, X-Requested-With, Content-Type, Accept, Engaged-Auth-Token'
    };
    

提交回复
热议问题