org.springframework.http.client

Interface ClientHttpResponse

    • Method Detail

      • getStatusCode

        HttpStatus getStatusCode()
                          throws java.io.IOException
        Return the HTTP status code of the response.
        Returns:
        the HTTP status as an HttpStatus enum value
        Throws:
        java.io.IOException - in case of I/O errors
        java.lang.IllegalArgumentException - in case of an unknown HTTP status code
        See Also:
        HttpStatus.valueOf(int)
      • getRawStatusCode

        int getRawStatusCode()
                      throws java.io.IOException
        Return the HTTP status code (potentially non-standard and not resolvable through the HttpStatus enum) as an integer.
        Returns:
        the HTTP status as an integer
        Throws:
        java.io.IOException - in case of I/O errors
        Since:
        3.1.1
        See Also:
        getStatusCode(), HttpStatus.resolve(int)
      • getStatusText

        java.lang.String getStatusText()
                                throws java.io.IOException
        Return the HTTP status text of the response.
        Returns:
        the HTTP status text
        Throws:
        java.io.IOException - in case of I/O errors
      • close

        void close()
        Close this response, freeing any resources created.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable