This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Help please, how to set the default paramSerializer to $httpParamSerializerJQLike? #13130
Closed
Description
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.
myApp.config(['$httpProvider', function ($httpProvider) {
$httpProvider.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded";
$httpProvider.defaults.paramSerializer = '$httpParamSerializerJQLike';
}]);
Thanks
Metadata
Metadata
Assignees
Labels
No labels