Restangular call

255 Views Asked by At
Restangular.all('patientService/edit').post($scope.patientService).then(function(patientService){
    $modalInstance.close(patientService);
     $route.reload()
});

where patientService/edit is a full path to the called method.(patientService) for class and (edit) for edit method .

It gives me an error 400 Bad Request

cannot we send this kind of request in restangular

2

There are 2 best solutions below

0
On

You might wish to look at the variables being passed in patientService. If the server is trying to map them to a class you will get a 400 if they are misspelt, do not exist or have incompatible data types.

0
On

In Restangular I would separate "/" :

Restangular.all('patientService').all('edit').post($scope.patientService).then(function()
{
});

But your problem could be elsewhere : perhaps this REST path couln't be understood server-side ?