Stream api code respond with 401 , even when every thing is ok ! using python

oauth
streaming
python
tweepy
api

#1

hello every one ,
am using python to get stream tweets , in linux distribution , every thing looks fine ,
but when am trying to get this tweets , always reponed by 401 , why i dont know , am using windows 7 alongside with linux , and it worked in win7 , so what 's happening , why this 401 error ,
btw :
i used my code in python 2 and 3 ,same error 401
i used different code to get stream tweets , same error 401
restful api is working ,
my date and time is on the time i geuss .same error 401

so where is the problem is it because of linux , as i should like make a service ON or some thing , please help me , and thanks in advance .


#2

Hi,

Could you provide more details. Maybe show your request/response.

I was having problem with 401 error, too. Mine is solved it by setting the “Content-type” header.

//it's in js, just for reference
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");