I'm trying to return the twitter API error object in this jsfiddle.
Here's the error:
{
errors: [
{
message: "Bad Authentication data",
code: 215
}
]
}
Here's the code:
var myApp = angular.module('myApp', []);
function MyCtrl($scope, $http) {
$http({
method: "GET",
url: "https://api.twitter.com/1.1/statuses/user_timeline.json",
responseType: "json",
params: {
screen_name: "StackCareers"
}
}).
success(function (data, status, headers, config) {
$scope.data = JSON.stringify(data);
}).
error(function (data, status, headers, config) {
$scope.data = JSON.stringify(data);
});
}
No comments:
Post a Comment