Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

It's problem as this

I add Token (http://www.django-rest-framework.org/api-guide/authentication/#tokenauthentication) in Headers but still get 401 How it fix?

UPDATE 1:

$http.post("<URL>/api/token-auth/", transformRequest({username: "newuser", "password": "newuser"}))
        .success(function(result){
            $scope.token = result.token;
            $http.defaults.headers.common = {
                'Authorization': "Token " + $scope.token,
                'Accept': 'application/json;odata=verbose'
            };
            $http.get(<URL>/urls/, transformRequest({name: name}))
                .success(getApiData);
        });
share|improve this question
    
You need to provide more information, like an excerpt of your angular code. – RodrigoDela Jan 9 at 0:54
    
Updated text add desc – user2724435 Jan 9 at 9:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.