title: Receiving CORS Errors when trying to send an Angular GET Request
body: <p>Here is my end point:</p>
  
  <p><a href="http://d.biossusa.com/api/distributor?key=#####" rel="nofollow noreferrer">http://d.biossusa.com/api/distributor?key=#####</a></p>
  
  <p>I get this response: </p>
  
  <pre><code>{"152":{"user":{"id":198,"firstname":null,"lastname":null,"username":"Lucerna-chem","email":"oliveri@lucerna-chem.ch","type":"Distributor","password_temp":null,"code":"omrotFVDQS3T75wTFUS67W0kUnXUpePrvaP5Pha9QevHjB0olSjPIxhmmJuZ","active":1,"logo_path":"lucerna-chem.jpg","created_at":"2014-10-15","updated_at":"2017-01-30","email_again":"","notification":"","send_invitation":"1","last_logged_in":null,"last_logged_out":null,"logged_in_count":"24","is_online":"0","group":"","cd_count":"10","mmd_count":"11"},"logo":"\/9j\/4AAQSkZJRgABAQEAYABgAAD\/2wBDAAIBAQIBAQICAgICAgICAwUDAwMDAwYEBAMFBwYHBwcGBwcICQsJCAgKCAcHCg0KCgsMDAwMBwkODw0MDgsMDAz\/2wBDAQICAgMDAwYDAwYMCAcIDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAz\/wAARCABBARUDASIAAhEBAxEB\/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL\/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKzt .........
  </code></pre>
  
  <p>I am trying to send an Angular GET request to that URL. 
  This is what I have: </p>
  
  <pre><code>&lt;script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.js"&gt;&lt;/script&gt;
  
  &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"&gt;&lt;/script&gt;
  
  &lt;div ng-app="myApp" ng-controller="myCtrl"&gt;
  
    &lt;p&gt;Today's welcome message is:&lt;/p&gt;
    &lt;h1&gt;{{myData}}&lt;/h1&gt;
  
  &lt;/div&gt;
  
  &lt;script&gt;
  
    var app = angular.module('myApp', []);
  
    app.config(['$httpProvider', function($httpProvider) {
      $httpProvider.defaults.useXDomain = true;
      delete $httpProvider.defaults.headers.common['X-Requested-With'];
    }
  
    ]);
  
    app.controller('myCtrl', function($scope, $http) {
      $http.get("http://d.biossusa.com/api/distributor?key=#####")
      .then(function(response) {
          $scope.myWelcome = response.data;
      });
  });
  
  
  &lt;/script&gt;
  </code></pre>
  
  <p>However, I keep on receiving CORS errors in the console. </p>
  
  <p><a href="https://i.stack.imgur.com/1zJNJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1zJNJ.png" alt="enter image description here"></a></p>
  
  <p>How do I prevent CORS errors? Is there anything that I can do get my data to display? </p>