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.
I try the following config to setup $httpProvider defaults, but the $httpParamSerializerJQLike is not invoked when I post a request using $http.post(myUrl, {phone: '18812222'}).then(func1, func2);. The form data in the post request is a JSON string {"phone":"18812222"}, which is not serialized JQLikely.
The text was updated successfully, but these errors were encountered:
KingMario
changed the title
Please, how to set the default paramSerializer to $httpParamSerializerJQLike?
Help please, how to set the default paramSerializer to $httpParamSerializerJQLike?
Oct 21, 2015
The paramSerializers are for serializing...params (not the payload/data of the request).
I.e. $http.get('/url', {params: {foo: 'bar'}}).
Currently, automatically serializing the data is not supported (but you could use the provided paramSerializers to serialize it manually).
Closing as this works as expected atm and the feature request for adding support for serializing data is tracked in #6039.
BTW, you can use a paramSerializer to serialize payload/data, but you need a little setup and it is not guarranteed to work in all edge-cases, as it hasn't been designed/tested for that purpose.
See #6039 (comment).
I try the following config to setup $httpProvider defaults, but the $httpParamSerializerJQLike is not invoked when I post a request using
$http.post(myUrl, {phone: '18812222'}).then(func1, func2);
. The form data in the post request is a JSON string{"phone":"18812222"}
, which is not serialized JQLikely.Thanks
The text was updated successfully, but these errors were encountered: