My biggest problem about this question is I do not quite know how to phrase it. In javascript, if a delete button is called it runs the following function
$scope.delete = function(){
var params = {
username: 'thisGuy'
};
$http.delete(afHttp.baseUrl, params)
.success(function(data) {
});
}
while in spring I have
@DELETE
@Path("/{blah}")
public void getDeleteMssg(@RequestBody Person userName) throws Exception {
dao.delete(userName);
}
and an interface that
@Delete("delete from People where userName = #{userName}")
void delete(Person userName) throws Exception;
Here is my problem. When I do this, in my chrome console, I get the error 415 (Unsupported Media Type). And if I change my javascript to be $http.post(afHttp.baseUrl, params) it uses my add function on spring (instead of delete) and adds another username to the server which is not right. Can someone help me figure this out, or at least a good search word to find myself. Thanks.