Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从twitter(python)获取采样流时出现问题_Python_Twitter - Fatal编程技术网

从twitter(python)获取采样流时出现问题

从twitter(python)获取采样流时出现问题,python,twitter,Python,Twitter,我尝试使用以下代码获取采样流: url = "https://api.twitter.com/labs/1/tweets/stream/sample" bearer_token = get_bearer_token(##########, #########) bearer = "Bearer " + bearer_token headers = {"Authorization": bearer} prin

我尝试使用以下代码获取采样流:

         url = "https://api.twitter.com/labs/1/tweets/stream/sample"
         bearer_token = get_bearer_token(##########, #########)
         bearer = "Bearer " + bearer_token
         headers = {"Authorization": bearer}
         print(requests.post(url, headers=headers))
我正在使用oauth


不幸的是,它给了我405的回复。非常感谢您的帮助。

看起来您正在使用POST vs GET

请在此处查看API参考: