I'm encountering some challenges while trying to execute a post request to my Spring Rest service hosted on localhost.
Although the request and the service are functioning properly, the issue I am facing is that I continuously receive an error indicating that there is something wrong with my JSON.
This is the code snippet I am utilizing to formulate the JSON request:
$scope.addComment = function(){
var url = "http://localhost:8080/evenement/"+evenementId+"/deelnemers/"+deelnemer.id+"/addComment";
$http.post(url, {"content" : $scope.data.comment, "author":"testUser"}).then(function(res){
$scope.response = res.data;
console.log(res.data);
});
};
I have attempted various approaches such as removing quotes, using single quotes, and even no quotes as suggested in responses to similar questions.