title: Angular JS - Blank Error Response
body: <p>I am learning Angular JS and am facing an issue with an the HTTP Get Request. Here is my code:</p>
  
  <pre><code>function countryController($scope,$http) {
  delete $http.defaults.headers.common['X-Requested-With'];
  $http.get("http://localhost:8080/countrybook/api/v1/countrybook")
      .success(function(response) {
          $scope.countries = response;
      })
      .error(function(response){
          alert(response);
      });
  }
  </code></pre>
  
  <p>I get a blank error response (alert with nothing in it. when i debug in firebug i see that response is "") for some reason.</p>
  
  <p>My headers look like this:</p>
  
  <p>Response Headers:</p>
  
  <pre><code>Cache-Control   private, must-revalidate
  Content-Length  355
  Content-Type    application/javascript
  Date    Sat, 15 Nov 2014 16:53:52 GMT
  Last-Modified   Sat, 15 Nov 2014 16:52:06 GMT
  Server  WebStorm 9.0.1
  </code></pre>
  
  <p>Request Headers:</p>
  
  <pre><code>Accept  */*
  Accept-Encoding gzip, deflate
  Accept-Language en-US,en;q=0.5
  Cache-Control   max-age=0
  Connection  keep-alive
  Host    localhost:63342
  If-Modified-Since   Sat, 15 Nov 2014 16:52:06 GMT
  Referer http://localhost:63342/CountryBook/index.html
  User-Agent  Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
  </code></pre>
  
  <p>and the Response that I see in Firebug is this:</p>
  
  <pre><code>function countryController($scope,$http) {
      delete $http.defaults.headers.common['X-Requested-With'];
      $http.get("http://localhost:8080/countrybook/api/v1/countrybook")
          .success(function(response) {
              $scope.countries = response;
          })
          .error(function(response){
              alert(response);
          });
  }
  </code></pre>
  
  <p>Could you please help me figure out whats wrong? When I use the same link mentioned above in the http get request directly from the browser I see the response that I expect. Thanks for your help!</p>