2

I am trying to send POST request which contains url param, url query params and body.

My resource looks like this:

return $resource(myService.getResourceUrl('/users/:username/password'), {}, {
    resetPassword: {
        method: 'POST',
        params: {passwordResetToken: '@passwordResetToken'}
    }
});

Resource is used in service:

 resetPassword: function(username, password, config){
        return ru.handleErrors(passwordManagerResource.save({username: username}, password, config).$promise);
    }

And finally service is called in the main controller:

var config = {passwordResetToken: '39af3539-12f8-4285-8a96-526a25c0fa00'};

var password = {password: 'Aaaaaaaa01'};

userManagementService.resetPassword("test_user", password, config).then(function(res){
        console.log("helllloooo_again");
}

However query parameters are not added to the url. Generated URL has following structure:

http://localhost:8080/ghostwriter/users/test_user/password

instead of http://localhost:8080/ghostwriter/users/test_user/password?passwordResetToken=39af3539-12f8-4285-8a96-526a25c0fa00

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.