Class Response

    • Method Detail

      • getStreamAsBytearray

        public byte[] getStreamAsBytearray()
                                    throws IOException
        Converts the inputstream to a string in UTF-8. Subsequent the inputstream will be empty/closed.
        Throws:
        IOException
      • getStreamAsString

        public String getStreamAsString()
                                 throws IOException
        Converts the inputstream to a string in UTF-8. Subsequent the inputstream will be empty/closed.
        Throws:
        IOException
      • getStreamAsString

        public String getStreamAsString​(String encoding)
                                 throws IOException
        Converts the inputstream to a string with the given encoding. Subsequent the inputstream will be empty/closed.
        Throws:
        IOException
      • getStreamAsString

        public String getStreamAsString​(Charset charset)
                                 throws IOException
        Converts the inputstream to a string with the given encoding. Subsequent the inputstream will be empty/closed.
        Throws:
        IOException
      • getStatusCode

        public int getStatusCode()
      • getContentEncoding

        public String getContentEncoding()
      • getContentType

        public String getContentType()
      • isFailed

        public boolean isFailed()
        Returns true if the http status code is not between 200 and 299
      • isInformational

        public boolean isInformational()
        Returns true if the http status code is not between 100 and 199
      • isSucceded

        public boolean isSucceded()
        Returns true if the http status code is between 200 and 299
      • isRedirection

        public boolean isRedirection()
        Returns true if the http status code is between 300 and 399
      • isClientError

        public boolean isClientError()
        Returns true if the http status code is between 400 and 499
      • isServerError

        public boolean isServerError()
        Returns true if the http status code is between 500 and 599
      • getHeaderField

        public String getHeaderField​(String name)