Hi ,
I am trying to access specific tag or user public feed cilent side using Jquery , Ajax and JS. but i am getting error.
see my code below.
$.ajax({
url: “https://api.twitter.com/1.1/search/tweets.json”,
type: “POST”,
data: {q:‘twitter’ },
cache: false,
dataType: ‘jsonp’,
beforeSend: setHeader,
success: function(data) { alert(‘hello!’); console.log(data);},
error: function(html) { alert(html); },
});
function setHeader(xhr) {
if(xhr && xhr.overrideMimeType) {
xhr.overrideMimeType(“application/j-son;charset=UTF-8”);
}
xhr.setRequestHeader(‘Authorization: OAuth oauth_consumer_key=“7a3ansbRTfOBdX4hn2sQJp72a”, oauth_nonce=“f07786e34733202848a46124dd73afcf”, oauth_signature=“TonfG1pbS%2BseiXOlyYl44oZAwPw%3D”, oauth_signature_method=“HMAC-SHA1”, oauth_timestamp=“1435660267”, oauth_token=“468141855-Id6phQoOE66n9CBzAdwEUAuQI2TBmxGyUHL9xarx”, oauth_version=“1.0”’);
}
}
but it getting 401 and 400 error.