Interface HttpResponse

All Superinterfaces:
AutoCloseable

public interface HttpResponse extends AutoCloseable
After receiving and interpreting a request message, a server responds with an HTTP response message.
  • Method Details

    • getHttpVersion

      String getHttpVersion()
      Returns the http version for this response.
      Returns:
      the http version for this response
    • getStatusCode

      int getStatusCode()
      Returns the status code for this response.
      Returns:
      the status code for this response
    • getReasonPhrase

      String getReasonPhrase()
      Returns the reason phrase for this response.
      Returns:
      the reason phrase for this response
    • getAllHeaders

      HttpHeader[] getAllHeaders()
      Returns all the headers of this response.
      Returns:
      all the headers of this response
    • getHeaders

      HttpHeader[] getHeaders(String name)
      Returns all the headers with a specified name of this response.
      Parameters:
      name - the name of the headers to return
      Returns:
      the headers whose name property equals name
    • getFirstHeader

      HttpHeader getFirstHeader(String name)
      Returns the first header with a specified name of this response.
      Parameters:
      name - the name of the header to return
      Returns:
      the first header whose name property equals name or null if no such header could be found
    • getContent

      InputStream getContent()
      Obtains the content of this response, if any.
      Returns:
      the content of this response, or null when there is no content