title: AngularJS basic auth
body: <p>Why do i get a 401 with this? The credentials are correct.</p>
  
  <pre><code>  app.config(['$httpProvider', function($httpProvider) {  
        $httpProvider.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded";
        $httpProvider.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
        $httpProvider.defaults.headers.common.Authorization = 'Basic ' + btoa("xxx:yyy");
        $httpProvider.defaults.headers.common.withCredentials = true;
    }
  </code></pre>
  
  <p>....</p>
  
  <pre><code> $http({
      method: "POST",
      url: url
      data: data,
  })
  </code></pre>