Пытаюсь отправить ajax запрос:
$.ajax({
contentType : 'application/json; charset=utf-8',
type : 'get',
url : 'order/get/'+i,
dataType : 'json',
data : {},
success : function(result) {
alert("Successfully!");
},
error : function(result, status, er) {
alert("error: "+result+" status: "+status+" er:"+er);
}
});
Метод который принимает его:
@RequestMapping(value = "/order/get/{id}", method = RequestMethod.GET)
public ResponseEntity<Order> getOrder(
@PathVariable("id") long id) {
Order order = orderService.getOrderById(id);
if (order == null) {
new ResponseEntity<Order>(HttpStatus.NOT_FOUND);
}
return new ResponseEntity<Order>(order, HttpStatus.OK);
}
Запрос обрабатывается и возвращается значение, но в клиенте возникает ошибка:
GET net::ERR_CONNECTION_RESET
Все что извесно об ошибке это:
X-Requested-With result = Object {readyState: 0, responseJSON: undefined, status: 0, statusText: "error"}, status = "error", er = ""}