Getting 415(unsupported media type ) in ajax formdata post resuest to spring

324 Views Asked by At

Want to send image data through ajax to the controller .But error 415 gets .I am using angular js and send images to the controller . But error ocurs . Please help

        fd= new FormData();                 
        fd.append("image", imageall);                            
        call(fd);
    });
}

function call(fd){
    $http({        
         method: 'POST',
         contentType: "application/json; charset=utf-8",
         url: "./WQF00069/update.app",
         data: fd,
         processData: false,
         enctype:'multipart/form-data',
         transformRequest: angular.identity,
         cache: false,
         timeout: 600000,
         headers: { 'Content-Type': undefined},
     }).success(function(data) {
         Flash.create('info', ' Update Success Fully ', 'large-text');
         `enter code here`
     }).error(function(response){ 
         console.dir(response);
        Flash.create('danger','There is a  Problem.Contact With Administrator', 'large-text');       
     });
}
0

There are 0 best solutions below