I'm trying to get some data from an external API using angular $http.get method , but i'm getting 'html code' instead of 'json object' in response. When i tried calling the API using jquery ajax it worked fine. Here's the code
$http.get({
"url": 'https://ebaydemo.stamplayapp.com/api/cobject/v1/projects',
"crossDomain": true,
"headers": {
"accept": "application/json",
"content-type": "application/json"
},
"params": {
"populate": false,
"n": 10
},
"processData": false
}).success(function (response) {
console.log(response);// Response has 'html code'
});
Edit Here's the short snippet of response i'm getting now:
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-- >
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<base href="/">
<title></title>