Interface HTTPResponse

  • All Implemented Interfaces:

    
    public interface HTTPResponse
    
                        

    A response from an HTTP request.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract HTTPRequest getRequest() The HTTPRequest of this response.
      abstract URL getUrl() The URL which was used to do the request to.
      abstract Map<String, String> getHeaders() The response headers received from the request.
      abstract Integer getStatus() The status code from the HTTP response message received from the request.
      abstract String getStatusText() The HTTP response message, if any, returned from a server.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • getUrl

         abstract URL getUrl()

        The URL which was used to do the request to.

        Note that, in case of redirects it can be different from the original request URL.

      • getHeaders

         abstract Map<String, String> getHeaders()

        The response headers received from the request.

        In case of multiple values per key, the values are comma separated.

      • getStatus

         abstract Integer getStatus()

        The status code from the HTTP response message received from the request.

        From responses like HTTP/1.0 200 OK, extracts the number 200.

      • getStatusText

         abstract String getStatusText()

        The HTTP response message, if any, returned from a server.

        From responses like HTTP/1.0 200 OK, extracts the Strings "OK".

        Returns null if none could be discerned from the responses (the result was not valid HTTP).