var reader = new FileReader();
reader.onload = function(){
var fileData = reader.result;
$http({
url: 'rs/submit',
method: 'POST',
data: {
'img': fileData,
'query': query,
'limit': limit
}
})
.then(function successCallback(response) {
}, function errorCallback(response) {
});
};
reader.readAsDataURL(document.getElementById('submitFileInput').files[0]);
I'm trying to send a image to my django back end using angular js as you can see above, but I get a error in the back end that says:
[22/Dec/2018 12:59:34] "POST /dynamic-mosaic/rs/submit HTTP/1.1" 200 4
[22/Dec/2018 12:59:34] code 414, message Request-URI Too Long
[22/Dec/2018 12:59:34] "" 414 -
I thought POST can send requests of almost any size, the image isnt even that big like 1-2MB
Anyone knows the cause? Maybe I'm not using angular js $http service properly.