Unauthorized GET sample stream API



I am new with twitter streaming AP,
i get 401 unauthorized response when i try the sample example:

when the username & password question arise i try 3 things:

  1. my twitter username & password
  2. my Consumer Key (API Key) & Consumer Secret (API Secret)
  3. Access Token & Access Token Secret

none of them worked.
someone can please help with that ?


You cannot connect to the Twitter API using a web browser. You should use OAuth-capable code to connect.


I wrote simple code and it worked!