title: How to fix No 'Access-Control-Allow-Origin' header on angular 1 + ajax + CORS policy?
body: <p>I do not know how to fix this problem on my code.
  My code is below:</p>
  
  <pre><code>$http({
              method: 'POST',
              url: "http://urlexample.com.br",
              headers : {                                        
                  "Content-Type": "application/x-www-form-urlencoded;charset=utf-8;",                   
                  "Access-Control-Allow-Origin": "*",
                  "Access-Control-Allow-Headers" : "X-Custom-Header",
                  "Access-Control-Allow-Credentials": true,            
                  "Access-Control-Allow-Methods": "POST",
                  "Accept" : "application/x-www-form-urlencoded;charset=utf-8;"
              },                
              data: {
                  "username": login,
                  "password": senha
              }
          }).then(function (success) {
              callback(success);
          }, function (error) {
              errorCallback(error);
          });
  </code></pre>
  
  <p>and the errors is this:</p>
  
  <blockquote>
    <p>"has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource."</p>
  </blockquote>
  
  <p>Thanks.</p>