接口 HttpClientResponse

  • 所有超级接口:
    java.lang.AutoCloseable, java.io.Closeable
    所有已知实现类:
    DefaultClientHttpResponse, JdkHttpClientResponse

    public interface HttpClientResponse
    extends java.io.Closeable
    Represents a client-side HTTP response.
    作者:
    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.
    • 方法详细资料

      • getHeaders

        Header getHeaders()
        Return the headers of this message.
        返回:
        a corresponding HttpHeaders object (never null)
      • getBody

        java.io.InputStream getBody()
                             throws java.io.IOException
        Return the body of the message as an input stream.
        返回:
        String response body
        抛出:
        java.io.IOException - IOException
      • getStatusCode

        int getStatusCode()
                   throws java.io.IOException
        Return the HTTP status code.
        返回:
        the HTTP status as an integer
        抛出:
        java.io.IOException - IOException
      • getStatusText

        java.lang.String getStatusText()
                                throws java.io.IOException
        Return the HTTP status text of the response.
        返回:
        the HTTP status text
        抛出:
        java.io.IOException - IOException
      • close

        void close()
        close response InputStream.
        指定者:
        close 在接口中 java.lang.AutoCloseable
        指定者:
        close 在接口中 java.io.Closeable