OkHttpClient close connection

前端 未结 1 1091
粉色の甜心
粉色の甜心 2021-01-04 05:22

I\'d like to use OkHttpClient to load a url, and if the website at the given url responds with a pdf content type I will go ahead and download the PDF, otherwise I want to i

相关标签:
1条回答
  • 2021-01-04 05:27

    Calling response.body().close() will release all resources held by the response. The connection pool will keep the connection open, but that'll get closed automatically after a timeout if it goes unused.

    0 讨论(0)
提交回复
热议问题