Trying to send base64 string for an image in the query param, and Getting 400 Bad Request. Tried the following:-
Gone through this question on stack overflow. According to this, chrome can have more characters in the URL than what I am sending as imageBytes(29527 characters),
What is the maximum possible length of a query string ?
Instructions in the following Question also didn't help
Passing base64 encoded strings in URL ?
Here is my code
It works fine if i am sending a hard coded string like this "something" in place of form.imageBytes
$scope.submit = function(){
var form = {};
form.name = document.getElementById("recipient-name").value;
form.desc = document.getElementById("message-text").value;
form.owner = document.getElementById("message-text2").value;
form.imageBytes = $scope.asdf;
var data = JSON.stringify(form);
debugger;
var postString = "http://cos1plp:7030/tcw/interestgroup/addInterestGroups?name="+form.name+"&desc="+form.desc+"&owner="+form.owner+"&imageBytes="+form.imageBytes;
$http.post(postString)
.success(function (data, status, headers, config) {
$scope.headers = headers();
console.log('Response Headers:' + headers());
})
.error(function (data, status, headers, config) {
$scope.headers = headers();
});
}