title: django rest framework problems with passing the header
body: <p>I'm trying to pass the token to the backend but I'm having some issues.</p>
  <p>when I'm writing this in the cmd:</p>
  <pre><code>curl -H &quot;Authorization: Token 3c9c6079602737a04fcb6b2e737804142ef93930e4e705c0598b2fc597759f7f&quot;  http://127.0.0.1:8000/api/auth/user/
  
  </code></pre>
  <p>I get the user like I wanted.</p>
  <p>but when I'm sending the request from the postman / frontend, I get this error:</p>
  <pre><code>{
      &quot;detail&quot;: &quot;Authentication credentials were not provided.&quot;
  }
  </code></pre>
  <p>here is my service at the frontend</p>
  <pre><code>const config = {headers: {Authorization: `Token ${token}`}}
  
  async function query() {
      try { 
          return await axios.get(`http://127.0.0.1:8000/api/${types.TODO_API}/`, null, config);
      } catch (err) {
          throw err;
      };
  };
  </code></pre>
  <p>when I'm sending the req, in the XHR - Networks I see it in query string params like this:
  <code>headers: {&quot;Authorization&quot;:&quot;Token 50633f123efeb7b3f122e5e3ee4e9206463dfa5b413cacca475ab9ffd743da8f&quot;}</code></p>
  <p>here is an image of postman
  <a href="https://i.stack.imgur.com/SvU1a.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SvU1a.png" alt="image of the req in postman" /></a></p>
  <p>here is my setting.py</p>
  <pre><code>INSTALLED_APPS = [
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
      'rest_framework',
      'corsheaders',
      'todo',
      'user',
      'knox'
  ]
  
  REST_FRAMEWORK = {
      'DEFAULT_AUTHENTICATION_CLASSES':  (
          'knox.auth.TokenAuthentication',
      )
  }
  
  REST_KNOX = {
      'TOKEN_TTL': timedelta(hours=10000),
      'USER_SERIALIZER': 'knox.serializers.UserSerializer',
  }
  
  CORS_ALLOW_HEADERS = [
      'accept',
      'accept-encoding',
      'authorization',
      'content-type',
      'dnt',
      'origin',
      'user-agent',
      'x-csrftoken',
      'x-requested-with',
      'access-control-allow-origin',
  ]
  
  CORS_ALLOW_CREDENTIALS = True
  </code></pre>
  <p>here is the TodoViewSet, which also use the token, but not working unless i send the req + token from the cmd.</p>
  <pre><code>class TodoViewSet(viewsets.ModelViewSet):
      permission_classes = (permissions.IsAuthenticated, )
      serializer_class = TodoSerializer
  
      def get_queryset(self):
          return self.request.user.todo.all()
  
      def preform_create(self, serializer):
          serializer.save(owner = self.request.user)
  </code></pre>
  <p>here is the GetUserView</p>
  <pre><code>class GetUserView(generics.RetrieveAPIView):
      permission_classes = (permissions.IsAuthenticated,)    
      serializer_class = UserSerializer
      
      def get_object(self):
          return self.request.user
  </code></pre>