0
我想从前端应用程序发送POST请求到一个复杂的JSON对象。开机自检时发生错误
后端侧
我有一类名为NotificationService和一个名为writeNotification方法如下:
@POST
@Path(SERVICE_PATH_WRITENOTIFICATION)
public Response writeNotification(@FormParam("notification") String notification)
前端侧
我发这样的:
var obj = [ {
to : $scope.formComboDestinatari.listaDestinatari,
subject : $scope.formOggetto,
date : "xxx",
body : $scope.formTesto,
type : $scope.formComboTipologia
} ];
如果我用这个语法:
Restangular.one('serverpath/writenotification').post(obj);
当我尝试发送我有这样的错误请求:
500 internal server error
如果我用这个语法:
Restangular.one('serverpath').post('writenotification', obj);
400 Bad request
我不会rstand我的错在哪里。