Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POST with number response #55

Closed
vincent314 opened this issue Mar 30, 2017 · 1 comment
Closed

POST with number response #55

vincent314 opened this issue Mar 30, 2017 · 1 comment

Comments

@vincent314
Copy link

Hi,

My POST service response is just a number (ie 1234). When I use restangular post method, I get an error Cannot create property ‘route’ on number ’1234’. I assume that Restangular tries to decorate a Javascript number and fails.

Is a number a valid response for a REST service and should Restangular be fixed for this kind of response ? If I fix the service and return nothing, Restangular post method works perfectly. Should I stick on this solution ?

Restangular 0.1.30
angular 2.4.10

@logvinoleg89
Copy link
Collaborator

Hi @vincent314, number is not a valid response. Restangular expect JSON Objects in response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants