Mixed POST submit from AngularJS to Spring RestController
问题 Basically I want to be able to post a form with some fields (JSON) and an attachment (multipart). Following is actually working code, the problem is that I don't like it so it mainly functions because of workarounds. Angular controller $http({ method: 'POST', url: 'rest/store/logo', headers: {'Content-Type': undefined }, transformRequest: function (data) { var formData = new FormData(); //need to convert our json object to a string version of json otherwise the browser will do a 'toString()'