Restangular won't change Http Content-Type Restangular won't change Http Content-Type angularjs angularjs

Restangular won't change Http Content-Type


As said in comment above and According to docs you should pass headers as fourth parameter. So your code should be

    $rootScope.objects.user.withHttpConfig({        transformRequest: angular.identity    }).customPUT(         $scope.objects.user,          undefined,          undefined,          {             'Content-Type': "multipart/form-data"         }   ).then(function(resp) {        if (resp == "OK") {            $scope.successes = [{                msg: "Saved"            }];        }    }, function(err) {        console.log(err);        $scope.errors = err.data.errors;    });

Reference url : https://github.com/mgonto/restangular#custom-methods