类 DefaultHttpClientRequest

  • 所有已实现的接口:
    HttpClientRequest, java.io.Closeable, java.lang.AutoCloseable

    public class DefaultHttpClientRequest
    extends java.lang.Object
    implements HttpClientRequest
    HttpClientRequest implementation that uses apache http client to execute streaming requests.
    作者:
    mai.jh
    • 字段概要

      字段 
      修饰符和类型 字段 说明
      private org.apache.http.impl.client.CloseableHttpClient client  
    • 构造器概要

      构造器 
      构造器 说明
      DefaultHttpClientRequest​(org.apache.http.impl.client.CloseableHttpClient client)  
    • 方法概要

      所有方法 静态方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      (专用程序包) static org.apache.http.client.methods.HttpRequestBase build​(java.net.URI uri, java.lang.String method, RequestHttpEntity requestHttpEntity)  
      void close()  
      HttpClientResponse execute​(java.net.URI uri, java.lang.String httpMethod, RequestHttpEntity requestHttpEntity)
      execute http request.
      private static void replaceDefaultConfig​(org.apache.http.client.methods.HttpRequestBase requestBase, HttpClientConfig httpClientConfig)
      Replace the HTTP config created by default with the HTTP config specified in the request.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 字段详细资料

      • client

        private final org.apache.http.impl.client.CloseableHttpClient client
    • 构造器详细资料

      • DefaultHttpClientRequest

        public DefaultHttpClientRequest​(org.apache.http.impl.client.CloseableHttpClient client)
    • 方法详细资料

      • execute

        public HttpClientResponse execute​(java.net.URI uri,
                                          java.lang.String httpMethod,
                                          RequestHttpEntity requestHttpEntity)
                                   throws java.lang.Exception
        从接口复制的说明: HttpClientRequest
        execute http request.
        指定者:
        execute 在接口中 HttpClientRequest
        参数:
        uri - http url
        httpMethod - http request method
        requestHttpEntity - http request entity
        返回:
        HttpClientResponse
        抛出:
        java.lang.Exception - ex
      • build

        static org.apache.http.client.methods.HttpRequestBase build​(java.net.URI uri,
                                                                    java.lang.String method,
                                                                    RequestHttpEntity requestHttpEntity)
                                                             throws java.lang.Exception
        抛出:
        java.lang.Exception
      • replaceDefaultConfig

        private static void replaceDefaultConfig​(org.apache.http.client.methods.HttpRequestBase requestBase,
                                                 HttpClientConfig httpClientConfig)
        Replace the HTTP config created by default with the HTTP config specified in the request.
        参数:
        requestBase - requestBase
        httpClientConfig - http config
      • close

        public void close()
                   throws java.io.IOException
        指定者:
        close 在接口中 java.lang.AutoCloseable
        指定者:
        close 在接口中 java.io.Closeable
        抛出:
        java.io.IOException