Friday 14 October 2016

Error: [$http:badreq] Http request configuration url must be a string. Received


$http.get is a shortcut method for $http({ method: 'GET' }), and expects the URL as the first parameter.


Solution:
 
$http({
  method: 'JSONP',
  url: url
}).then(function successCallback(response) {
  // ok
}, function errorCallback(response) {
  // ko
});



No comments:

Post a Comment

Spring boot with CORS

CORS (Cross-Origin Resource Sharing) errors occur when a web application running in a browser requests a resource from a different domain or...