org.springframework.web.client

Class RestClientResponseException

    • Constructor Detail

      • RestClientResponseException

        public RestClientResponseException(java.lang.String message,
                                           int statusCode,
                                           java.lang.String statusText,
                                           @Nullable
                                           HttpHeaders responseHeaders,
                                           @Nullable
                                           byte[] responseBody,
                                           @Nullable
                                           java.nio.charset.Charset responseCharset)
        Construct a new instance of with the given response data.
        Parameters:
        statusCode - the raw status code value
        statusText - the status text
        responseHeaders - the response headers (may be null)
        responseBody - the response body content (may be null)
        responseCharset - the response body charset (may be null)
    • Method Detail

      • getRawStatusCode

        public int getRawStatusCode()
        Return the raw HTTP status code value.
      • getStatusText

        public java.lang.String getStatusText()
        Return the HTTP status text.
      • getResponseHeaders

        @Nullable
        public HttpHeaders getResponseHeaders()
        Return the HTTP response headers.
      • getResponseBodyAsByteArray

        public byte[] getResponseBodyAsByteArray()
        Return the response body as a byte array.
      • getResponseBodyAsString

        public java.lang.String getResponseBodyAsString()
        Return the response body as a string.