title: How do I remove headers from a $http.get request and also add "application/json" and "text/plain" to "Accept"
body: <p>I am a newbie to angularjs and I am trying to add some new functionality to an existing angular js app.
  All the existing calls are wrapped in complex logic so I thought I would make a call directly. Here is the code for my call:</p>
  
  <p><a href="https://i.stack.imgur.com/CktpX.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CktpX.jpg" alt="code for my new call"></a></p>
  
  <p>When existing calls are made to the api from the angularjs code they work and have the following headers in the top of the image below (marked with "Works" in red text). My new call adds Access-Control-Request-Headers and Access-Control-Request-Method like in the bottom half of the image below (marked with "Fails" in red text).</p>
  
  <p><a href="https://i.stack.imgur.com/9fcK0.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9fcK0.jpg" alt="success and failing calls"></a></p>
  
  <p>When I look in the Console of Chrome I see the following error for my new request: XMLHttpRequest cannot load <a href="http://localhost/blablabla/v1/login.json" rel="nofollow noreferrer">http://localhost/blablabla/v1/login.json</a>. Request header field Authorization is not allowed by Access-Control-Allow-Headers.</p>
  
  <p>I am also missing "application/json" and "text/plain" from the "Accept" header in the request. How can I add these to "Accept" and also get rid of the "Access-Control-Request-Headers" and "Access-Control-Request-Method"?</p>