Class HTTPResponse


  • public class HTTPResponse
    extends java.lang.Object
    A class to represent an HTTP response.
    • Constructor Summary

      Constructors 
      Constructor Description
      HTTPResponse()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addHeader​(java.lang.String aKey, java.lang.String aValue)
      Adds a header for key.
      byte[] getBytes()
      Returns the bytes.
      int getCode()
      Returns the response return code.
      java.lang.String getContentType()
      Returns the content type.
      java.util.List<java.lang.String> getCookies()
      Returns the cookies.
      java.lang.String getCookieString()
      Returns the cookie string.
      java.util.List<HTTPRequest.Header> getHeaders()
      Returns the headers.
      java.lang.String getHeaderString()
      Returns the headers as a string.
      java.lang.String getMessage()
      Returns the response return message.
      long getResponseTime()
      Returns the response time in milliseconds.
      java.lang.String getSummary()
      Returns a response summary string.
      java.lang.String getText()
      Returns the response byte string.
      java.lang.String toString()
      Returns a string representation.
      • Methods inherited from class java.lang.Object

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

      • HTTPResponse

        public HTTPResponse()
    • Method Detail

      • getCode

        public int getCode()
        Returns the response return code.
      • getMessage

        public java.lang.String getMessage()
        Returns the response return message.
      • getHeaders

        public java.util.List<HTTPRequest.Header> getHeaders()
        Returns the headers.
      • addHeader

        public void addHeader​(java.lang.String aKey,
                              java.lang.String aValue)
        Adds a header for key.
      • getHeaderString

        public java.lang.String getHeaderString()
        Returns the headers as a string.
      • getCookies

        public java.util.List<java.lang.String> getCookies()
        Returns the cookies.
      • getCookieString

        public java.lang.String getCookieString()
        Returns the cookie string.
      • getContentType

        public java.lang.String getContentType()
        Returns the content type.
      • getBytes

        public byte[] getBytes()
        Returns the bytes.
      • getText

        public java.lang.String getText()
        Returns the response byte string.
      • getResponseTime

        public long getResponseTime()
        Returns the response time in milliseconds.
      • getSummary

        public java.lang.String getSummary()
        Returns a response summary string.
      • toString

        public java.lang.String toString()
        Returns a string representation.
        Overrides:
        toString in class java.lang.Object