requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(0 bytes read, 512 more expected)', IncompleteRead

后端 未结 2 1957

I wanted to write a program to fetch tweets from Twitter and then do sentiment analysis. I wrote the following code and got the error even after importing all the necessary

2条回答
  •  梦谈多话
    2021-01-07 00:04

    I had the same problem but without stream, and as stone mini said, just apply "with" clause before to make sure your request is closed before a new request.

        with requests.request("POST", url_base, json=task, headers=headers) as report:
            print('report: ', report)
    

提交回复
热议问题