I need help how to post headers, data and transformRequest and get response
it says "
401 Unauthorized
"
$http({
                url: '/user/Api/Securelogin/',
                method: "POST",
                transformRequest: transformRequestAsFormPost,
                headers: {
                    access_token : 'fcxjmozj75',
                    client_id : '123_APP',
                    client_secret : 'u06zzl2dxilxx'
                },
                data : {
                username: username, 
                password: password
                },
                  transformRequest: function(data, headers) {
                    headers()['Content-Type'] = 
'application/x-www-form-urlencoded; charset=utf-8';
                    var parsed = [];
                    angular.forEach(data, function(value, key) {
                      parsed.push(encodeURIComponent(key) + '=' + 
encodeURIComponent(value));
                    });
                    return parsed.join('&');
              }            
                }).success(function (response) {
                    callback(response);// assign  $scope.persons here as 
promise is resolved here 
                });

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to