I am trying to post a object array, I expect the post to post JSON like so
{"campaign":"ben",
"slots":[
{
"base_image": "base64 code here"
}
]
}
When I post I get this in the console
angular.js:9866 POST /ccuploader/Campaign/updateSlots 413 (Payload Too Large) (anonymous) @ angular.js:9866 n @ angular.js:9667 f @ angular.js:9383 (anonymous) @ angular.js:13248 $eval @ angular.js:14466 $digest @ angular.js:14282 $apply @ angular.js:14571 (anonymous) @ angular.js:21571 dispatch @ jquery.min.js:3 r.handle @ jquery.min.js:3 app.js:71 failed
Im not sure why my post is not working. Can someone point out my mistake ?
JavaScript code
$scope.SaveImage = function () {
$http({
url: "http://www.somesite.co.uk/ccuploader/Campaign/updateSlots",
method: "POST",
data: $.param({ 'campaign': "name", 'slots': $scope.slots }),
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
}).then(function (response) {
// success
console.log('success');
console.log("then : " + JSON.stringify(response));
}, function (response) { // optional
// failed
console.log('failed');
console.log(JSON.stringify(response));
});
};