Hi Everyone,
I am developing a Twitter program,which needs to get access for the
Twitter streaming API. I can use Http Clients (Apache Wink) to get
data from streaming API with no problem.

However, my application needs to use JavaScript to access the
Streaming API and receive data. I got failure in the first step:
trying to pass the basic auth... Instead, i always got the 401 reply
from twitter streaming api (unauthorized)

Here is some snippet from my code,
function send(arg)
               xmlhttp.onreadystatechange = callhandle;
               xmlhttp.setRequestHeader("Authorization", "Basic
   // for my account security reason, i changed the string for my
password and user name, but I am pretty sure the string in my original
code is correct because I got it from the printing of my successful
http clients example.

Is this because the cross-domain restriction? Is there any way which i
can use JS to access the streaming API to obtain data?


Reply via email to