Interface HttpResponse<T>

    • Method Detail

      • isSuccessful

        default boolean isSuccessful()
      • isSuccessful

        static boolean isSuccessful​(int code)
      • code

        int code()
        Returns the HTTP status code.
        Returns:
        the HTTP status code.
      • message

        default String message()
      • body

        T body()
        Get the body. If the body is Closeable, it should be closed by the caller.
        Returns:
        the body
      • bodyString

        default String bodyString()
                           throws IOException
        Return the body as a String. Or an empty String if there was no body (possibly discarded).
        If the body is an InputStream, it will be read as UTF-8.
        Returns:
        the body
        Throws:
        IOException - in case there's an I/O problem
      • request

        HttpRequest request()
        The original HttpRequest that initiated this response.
        Returns:
        the HTTP request.