это мой ajax:
Код: Выделить всё
$.ajax({
url : '/Hoadon/addhdproccess',
type : 'POST',
contentType : 'application/json',
data : JSON.stringify(hd),
beforeSend: function(xhr) {
// Gửi CSRF token trong header
xhr.setRequestHeader(csrfHeader, csrfToken);
},
success : function(response) {
alert("success");
console.log(response);
},
error : function(error) {
console.log("error: ", error.responseText);
alert("error");
}
});
Код: Выделить всё
@PostMapping("/Hoadon/addhdproccess")
public String addPage(@RequestBody Hoadon hd) {
System.out.println("I went inside");
}
Подробнее здесь: https://stackoverflow.com/questions/791 ... pring-boot
Мобильная версия