Class HttpConnection.Response

    • Method Detail

      • charset

        public java.lang.String charset()
        Description copied from interface: Connection.Response
        Get the character set name of the response, derived from the content-type header.
        Specified by:
        charset in interface Connection.Response
        Returns:
        character set name
      • charset

        public HttpConnection.Response charset​(java.lang.String charset)
        Description copied from interface: Connection.Response
        Set / override the response character set. When the document body is parsed it will be with this charset.
        Specified by:
        charset in interface Connection.Response
        Parameters:
        charset - to decode body as
        Returns:
        this Response, for chaining
      • contentType

        public java.lang.String contentType()
        Description copied from interface: Connection.Response
        Get the response content type (e.g. "text/html");
        Specified by:
        contentType in interface Connection.Response
        Returns:
        the response content type
      • parse

        public Document parse()
                       throws java.io.IOException
        Description copied from interface: Connection.Response
        Parse the body of the response as a Document.
        Specified by:
        parse in interface Connection.Response
        Returns:
        a parsed Document
        Throws:
        java.io.IOException - on error
      • body

        public java.lang.String body()
        Description copied from interface: Connection.Response
        Get the body of the response as a plain string.
        Specified by:
        body in interface Connection.Response
        Returns:
        body