类 JdkHttpClientResponse

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

    public class JdkHttpClientResponse
    extends java.lang.Object
    implements HttpClientResponse
    JDk http client response implement.
    作者:
    mai.jh
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      void close()
      close response InputStream.
      java.io.InputStream getBody()
      Return the body of the message as an input stream.
      Header getHeaders()
      Return the headers of this message.
      int getStatusCode()
      Return the HTTP status code.
      java.lang.String getStatusText()
      Return the HTTP status text of the response.
      • 从类继承的方法 java.lang.Object

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

      • conn

        private final java.net.HttpURLConnection conn
      • responseStream

        private java.io.InputStream responseStream
      • responseHeader

        private Header responseHeader
      • CONTENT_ENCODING

        private static final java.lang.String CONTENT_ENCODING
        另请参阅:
        常量字段值
    • 构造器详细资料

      • JdkHttpClientResponse

        public JdkHttpClientResponse​(java.net.HttpURLConnection conn)
    • 方法详细资料

      • getBody

        public java.io.InputStream getBody()
                                    throws java.io.IOException
        从接口复制的说明: HttpClientResponse
        Return the body of the message as an input stream.
        指定者:
        getBody 在接口中 HttpClientResponse
        返回:
        String response body
        抛出:
        java.io.IOException - IOException
      • getStatusCode

        public int getStatusCode()
                          throws java.io.IOException
        从接口复制的说明: HttpClientResponse
        Return the HTTP status code.
        指定者:
        getStatusCode 在接口中 HttpClientResponse
        返回:
        the HTTP status as an integer
        抛出:
        java.io.IOException - IOException
      • getStatusText

        public java.lang.String getStatusText()
                                       throws java.io.IOException
        从接口复制的说明: HttpClientResponse
        Return the HTTP status text of the response.
        指定者:
        getStatusText 在接口中 HttpClientResponse
        返回:
        the HTTP status text
        抛出:
        java.io.IOException - IOException
      • close

        public void close()
        从接口复制的说明: HttpClientResponse
        close response InputStream.
        指定者:
        close 在接口中 java.lang.AutoCloseable
        指定者:
        close 在接口中 java.io.Closeable
        指定者:
        close 在接口中 HttpClientResponse