Skip to content
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
@KingMario

Description

@KingMario

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions