When use post in AngularJS the content-type always confused me. Content-type:
- urlencoded
- undefined
...
$http({ headers: {'Content-Type': undefined}, processData: false, method: 'POST', cache: false, url: sendUrl, data: sendObj, transformRequest: function (data, headersGetterFunction) { return data; // do nothing! FormData is very good! } })
I post JSON data with file object.
I found out the content-type must set to undefined. Here is some clue. But I dont know why must set to undefined.