org.apache.http.client.utils

## Class HttpClientUtils

- java.lang.Object
- - org.apache.http.client.utils.HttpClientUtils

-     public class HttpClientUtils
      extends Object

  关闭响应和客户端对象的便利方法。
  从以下版本开始：
    4.2

- - ### 方法摘要

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `closeQuietly(CloseableHttpResponse response)` 无条件接近回应。
    `static void` | `closeQuietly(HttpClient httpClient)` 无条件关闭httpClient。
    `static void` | `closeQuietly(HttpResponse response)` 无条件接近回应。

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 方法详细信息

    - #### closeQuietly

          public static void closeQuietly(HttpResponse response)

      无条件接近回应。

      示例代码：

            HttpResponse httpResponse = null;
           try {
               httpResponse = httpClient.execute(httpGet);
           } catch (Exception e) {
               // error handling
           } finally {
               HttpClientUtils.closeQuietly(httpResponse);
           }

      参数
        `response` - 释放资源的HttpResponse可能为null或已经关闭。
      从以下版本开始：
        4.2

    - #### closeQuietly

          public static void closeQuietly(CloseableHttpResponse response)

      无条件接近回应。

      示例代码：

            HttpResponse httpResponse = null;
           try {
               httpResponse = httpClient.execute(httpGet);
           } catch (Exception e) {
               // error handling
           } finally {
               HttpClientUtils.closeQuietly(httpResponse);
           }

      参数
        `response` - 释放资源的HttpResponse可能为null或已经关闭。
      从以下版本开始：
        4.3

    - #### closeQuietly

          public static void closeQuietly(HttpClient httpClient)

      无条件关闭httpClient。 关闭底层连接管理器并释放资源。

      示例代码：

            HttpClient httpClient = HttpClients.createDefault();
           try {
             httpClient.execute(request);
           } catch (Exception e) {
             // error handling
           } finally {
             HttpClientUtils.closeQuietly(httpClient);
           }

      参数
        `httpClient` - HttpClient关闭，可能为null或已经关闭。
      从以下版本开始：
        4.2

Copyright © 1999–2017 The Apache Software Foundation. All rights reserved.

本帮助文档是使用 《谷歌翻译》翻译，请与英文版配合使用 by--QQ:654638585