title: AngularJS - set HTTP header for GET request
body: <p>May be this is a general issue, which can be available on internet, But what I got is here.</p>
  
  <p><a href="https://stackoverflow.com/questions/15598917/adding-a-custom-header-to-http-request-using-angular-js">Adding a custom header to HTTP request using angular.js</a></p>
  
  <p>So I followed the same, and changed the code to </p>
  
  <p>Setting header</p>
  
  <pre><code> var config = {headers:  {
                  'Authorization': 'XXXYYY token="xxxxxxxx", realm="dash-api"',
                  "X-Testing" : "testing"
                  }
              };
  </code></pre>
  
  <p>The get request call:</p>
  
  <pre><code>return $http.get(api.host+'/agn/12/adv/1860/cam?status=1', config).then(function (response) {
                      return {
                          status:"success",
                          data:response.data.data.active
                      };
                  }, function (error) {
                      return {
                          status:"error",
                          data:error
                      }
                  });
  </code></pre>
  
  <p>As you can see the request are going in method type OPTIONS, and the <code>Authorization</code> token is not set in the request.</p>
  
  <p>Please help me in this issue, as I am struggling from two days.</p>
  
  <p>Thanks a lot.</p>
  
  <p><img src="https://i.stack.imgur.com/fnpZT.png" alt="enter image description here"></p>