相关疑难解决方法(0)

Python-Requests关闭http连接

我想知道,你如何关闭与Requests(python-requests.org)的连接?

有了httplibHTTPConnection.close(),但我如何对请求做同样的事情?

代码如下:

    r = requests.post("https://stream.twitter.com/1/statuses/filter.json", data={'track':toTrack}, auth=('username', 'passwd'))

    for line in r.iter_lines():
        if line:
            self.mongo['db'].tweets.insert(json.loads(line))
Run Code Online (Sandbox Code Playgroud)

提前致谢.

python http urllib2 httplib python-requests

37
推荐指数
5
解决办法
9万
查看次数

标签 统计

http ×1

httplib ×1

python ×1

python-requests ×1

urllib2 ×1