Click here to Skip to main content
15,879,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi i have post request


function GetTokenfromGrap(resource, obj, failureCallback) {
            debugger;
            var deffered = $q.defer();
            resource = '/xxxxx.com/oauth2/token'
            var url = baseUrl + resource;
         
                var configurations = {
                    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
            }
            $http.post(url, obj, configurations).then(deffered.resolve).catch(function (data) {
                handleCatch(data);
                if (typeof failureCallback === 'function') failureCallback(data);
            });
            return deffered.promise;
        }




i want to add body to this request , how can i do this

What I have tried:

i googled it but i didn't get any solution
Posted
Updated 19-Jun-18 23:49pm
v2

1 solution

"obj" is the body.
 
Share this answer
 
Comments
Mahesh Alappuzha 20-Jun-18 6:37am    
i given the body as obj but getting a error "ReferenceError: data is not defined↵ at eval (eval at GetTokenfromGrap " how can i resolve this

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900