when I post Object data from app.js to homecontroller using two different methods (complete $http.post
and shorthand $http.post
) like below:
var book = {
"title" : $scope.addTitle,
"publisher" : $scope.publisherSelected[0],
"authors" : $scope.authorsSelected,
"genres" : $scope.genresSelected
};
//This one posts data successfully:
$http({
method : 'POST',
url : '../administrator/addBook',
data : book,
}).
//This one fails:
$http.post("../administrator/addBook", {
data : book
},
What is the difference between them? I thought they were the same.