-
Notifications
You must be signed in to change notification settings - Fork 840
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
remove method is hanging pending #193
Comments
hi again,
what i have also noticed is that there is difference in the request that is sent, and it maybe causing the problem. i have also noticed that restangular add this header only to get, while it should be json by the way i am using ASP.NET MVC with IIS 8 the $http method request body : the restangular method request body : Accept:application/json, text/plain, / |
Hey,
If you need it to be an empty request, just add a requestInterceptor like: RestangularProvider.setRequestInterceptor(function(elem, operation) {
if (operation === "remove") {
return undefined;
}
return elem;
}); That's the only difference I see that is important between those 2 requests. Did you check that the route is the same? Is the route OK? Bests! |
I don't remember if it's operation |
thank you very much for the response, the interceptor worked, why this is causing all the problems ?
|
The problem was caused because your server doesn't accept payload when doing DELETE. |
i have came at this SO thread and if you read darrel comment, he says that HTTP semantics state that Delete with Payload is not semantic |
With Restangular you can use whatever you want, that's the idae. If you need no Payload, you can do it, with this configuraiton I sent you above. That's the whole idea of Restangular that you can conigure easily and that it has some safe defaults. |
very true, thanks again for the support |
Not knowing this particular information caused a coworker and I to spend 4 or 5 hours trying to figure out why Chrome was refusing to make the remove request. Long story short, the issue I linked to (mgonto#193) helped solve the problem w/o using the $http workaround
👍 Just ran across this myself. Using:
Is the solution. |
The above doesn't work for me but this works: RestangularProvider.setRequestInterceptor(function(elem, operation) { |
@ralbu works for me! Thank you! RestangularProvider.setRequestInterceptor(function(elem, operation) {
if (operation === "remove") {
return null;
}
return elem;
}); |
How can I pass single parameter say an Integer in customPost and remove? Thanks |
It does not work. It still sends {} as payload, and what is worse, it sends Content-Type:text/plain;charset=UTF-8. |
Also run into the |
setRequestInterceptor is deprecated see here addRequestInterceptor works.
|
hi,
when i do for example
listItem.remove();
chrome keeps hanging until i refresh the page
Side note : i have to admit that i have came to see restangular like 3 or 4 times and could not understand the benefit until i played with the code and now i say wow you are genius, i makes life so much easier and code more concise, thanks for this awesome library
The text was updated successfully, but these errors were encountered: