Formdata发送到Java控制器获取415错误

这是我的代码,我正在使用angular和spring mvc。请给我建议

vm.upload= function(state_cd){

             fd= new FormData();
             fd.append("mst.distCd",dist_cd);
            call(fd);
         });
     }

    function call(fd){
         $http({
            type: "POST",url: "./WQF00069/update.app",data: fd,processData: false,headers: { 'Content-Type': undefined},transformRequest: angular.identity,cache: false,timeout: 600000,}).success(function(data) {
                flash.create('info',' Update Success Fully ','large-text');
            }).error(function(response){ 
                 console.dir(response);
                 flash.create('danger','There is a  Problem.Contact With Administrator','large-text');

         });
    }

发送到我的控制器后,出现415错误

wbenit 回答:Formdata发送到Java控制器获取415错误

尝试:

headers: { 'Content-Type': 'application/json'},


代替:

headers: { 'Content-Type': undefined},
本文链接:https://www.f2er.com/3162129.html

大家都在问