python - tornado的AsyncHTTPClient和requests库为什么不关闭连接?
PHPz
PHPz 2017-04-17 16:41:03
0
1
656
PHPz
PHPz

学习是最好的投资!

reply all(1)
刘奇

The connection AsyncHTTPClient has been closed for you, and the response you get is all the information returned by the server. AsyncHTTPClient已经帮你关闭了,你获得的response就是服务器返回的所有信息。

其他语言中之所以需要关闭,是因为它们通常只负责帮你创建连接,需要你自己创建请求、发送数据、处理应答、读取数据、当然还有相关异常,最后一切结束后关闭连接。

AsyncHTTPClient是更高级的封装,你只需要关注发送什么,然后中间过程全部由AsyncHTTPClient

The reason why closure is needed in other languages ​​is because they are usually only responsible for creating a connection for you. You need to create requests, send data, process responses, read data, and of course related exceptions, and finally close the connection after everything is finished. 🎜 🎜And AsyncHTTPClient is a more advanced encapsulation. You only need to pay attention to what is sent, and then all the intermediate processes are completed by AsyncHTTPClient for you. Finally, you can get the data. 🎜
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template