title: AngularJS $http header for getting token
body: <p>I am very new to angularJS.
  in my angular app, there is a form for login. i checked the API login endpoint on postman and i notice it generates a token after successfully logged in.</p>
  
  <p>I have a form to add blog post.</p>
  
  <p>I want only logged in user can add blog post. below snippet are associate with my add blog form, currently i cant post through this form, coz, it doesn't get authenticated, even if i logged in with my login form.</p>
  
  <p>but it works nice on postman.</p>
  
  <p>I heard of <code>$http header</code> but not getting how to implement this.</p>
  
  <p>It falls me in trouble for last 7 days, yet i couldnt fix this issue.</p>
  
  <p>can anyone help to fix this?</p>
  
  <p>Thanks</p>
  
  <pre><code>   $http({
              method: 'POST',
              url: 'http://127.0.0.1:8000/api/v1/blog',
              data: $scope.formBlogModel
          }).then(function (response) {
              $scope.success = 'post success'
          }, function(response) {
              $scope.error = "an error occured";
          });
  </code></pre>