You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
When you create a resource action with the GET method, you don't get to set the request body, only the request parameters, see here: https://code.angularjs.org/1.3.14/docs/api/ngResource/service/$resource#usage So it makes sense that you cannot use transformRequest with a body.
Sending a request body with a GET request, is kind of an edge case, as it is possible but not very useful in most cases - as far as I understand from this here Stackoverflow answer for example: http://stackoverflow.com/a/983458/787333
I assume we could add the possibility to add a request body to GEt requests, but it's probably not very useful.
In my case it seams to be a GET that I need : I get a list from an API and the parameters are some optional filters (example : /products?type=1®ion=3).
I need to format the query from a complexe object which is made with ngForm, that's why i'd like to proceed it in the transformRequest statement.
Issue : http://jsfiddle.net/uqr74s7g/4/
transformRequest doesn't receive the data in case of a GET request (first parameter is always undefined).
For POST request, the same code works as expected. I tried with the branch 1.2.x, 1.3.x, 1.4.x
Maybe it's a "normal" behaviour but in this case I'd like to know why. The documentation never mention that.
Thanks
The text was updated successfully, but these errors were encountered: