I use spring boot and jquery.
I do an ajax call.
var memberId = $('#memberId').val();
var type = "put";
var url = getHostName() + "/members/" + memberId + "/payments/" + paymentsId + "/process/" + paymentMode;
jQuery.ajax({
type: type,
url: url,
contentType: "application/json",
dataType: 'json',
success: function (data, status, jqXHR) {
loadMemberPaymentTable(templateMemberPayment, memberId);
},
error: function (jqXHR, status) {
check401Unauthorized(jqXHR);
}
});
This controller is called, and in error is called
jqXHR = Object {readyState: 4, responseText: "", status: 200, statusText: "OK"}, status = "parsererror"
dont know if its' the spring thing who is the problem or not
@RequestMapping(value = "/members/{memberId}/payments/{paymentsId}/process/{paymentMode}", method = RequestMethod.PUT)
public ResponseEntity<Void> processPayment(@PathVariable("memberId") Long memberId, @PathVariable("paymentsId") List<Long> paymentsId, @PathVariable("paymentMode") PaymentModeEnum paymentMode) {
paymentService.processPayment(paymentsId, paymentMode);
return new ResponseEntity<Void>(HttpStatus.OK);
}
Edit
Url called is http://localhost:8080/rest/members/6/payments/100,101/process/CASH
if i return a value from my controller... that work So it's seem the problem it's spring...
Don't seem to be the correct way, to return no value.
process can work or fail... so what is the correct way to send this to the client?
maybe there is something from spring boot to manage that?