I want to make a ajax call using $.POST. But I am getting 403 error. But GET works perfectly fine. My code is:
var url = "/xyz/abc/subscribe?name="+name;
$.post(url, function(data){
alert(data);
});
The controller code is :
@RequestMapping(value = "/xyz/abc/subscribe", method = RequestMethod.POST)
public @ResponseBody
String subscribe(@RequestParam("name") String name)
throws Exception {
String message = "TESTING";
return message;
}
But I'm getting a 403 error.