Content-Type header not being set with Angular $http

后端 未结 5 2100
逝去的感伤
逝去的感伤 2021-02-15 14:23

I\'m trying to make a cross-origin POST request using Angular $http with the following code.

//I\'ve tried setting and removing these http config options
$http.d         


        
5条回答
  •  迷失自我
    2021-02-15 15:06

    Than you very much "Liran B " your fix worked like a champ for me.... issue was bugging me from several hours....

    var req = {
                    method: 'GET',
                    url: '',
                    //headers: {
                    //    'Content-Type': 'application/json;charset=utf-8'
                    //},
                    data: ""
                };
    
      $http(req);
    

提交回复
热议问题