what’s up guys!
So, i’m trying to use the search api, i’m using jquery ajax to make the requests, but i’m getting the error
{“code”:32,“message”:“Could not authenticate you.”}, here’s my code:
var token = {
public: ‘76841884-j9NAmQkubosXIct53wOTvnUwEZjkSMc34fxeHoXWq’,
secret: ‘VvOY224jUeMUrmgg2aQqGSl11FLQiGcSSTAPflfrikKBO’
};
var request_data = {
url: 'https://api.twitter.com/1.1/search/tweets.json',
method: 'GET',
data:{q: query},
};
$.ajax({
url: request_data.url,
type: request_data.method,
data: request_data.data,
headers: oauth.toHeader(oauth.authorize(request_data, token)),
dataType: 'jsonp'
}).done(function (data) {
console.log(data);
});
i’m using MVC 5 at server side, but i just wanna use the jquery to do this.
Any help?
Thanks for the supporting.