接口 HttpClientResponse

所有超级接口:
AutoCloseable, Closeable
所有已知实现类:
DefaultClientHttpResponse, JdkHttpClientResponse

public interface HttpClientResponse extends Closeable
Represents a client-side HTTP response.
作者:
mai.jh
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    close response InputStream.
    Return the body of the message as an input stream.
    Return the headers of this message.
    int
    Return the HTTP status code.
    Return the HTTP status text of the response.
  • 方法详细资料

    • getHeaders

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

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

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

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

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