Interface RestClient.RequestHeadersSpec.ConvertibleClientHttpResponse

All Superinterfaces:
AutoCloseable, ClientHttpResponse, Closeable, HttpInputMessage, HttpMessage
Enclosing interface:
RestClient.RequestHeadersSpec<S extends RestClient.RequestHeadersSpec<S>>

public static interface RestClient.RequestHeadersSpec.ConvertibleClientHttpResponse extends ClientHttpResponse
Extension of ClientHttpResponse that can convert the body.
  • Method Details

    • bodyTo

      @Nullable <T> T bodyTo(Class<T> bodyType)
      Extract the response body as an object of the given type.
      Type Parameters:
      T - the body type
      Parameters:
      bodyType - the type of return value
      Returns:
      the body, or null if no response body was available
    • bodyTo

      @Nullable <T> T bodyTo(ParameterizedTypeReference<T> bodyType)
      Extract the response body as an object of the given type.
      Type Parameters:
      T - the body type
      Parameters:
      bodyType - the type of return value
      Returns:
      the body, or null if no response body was available