Package org.springframework.web.client

# Interface RestClient.RequestHeadersSpec.ExchangeFunction<T>

Type Parameters:
  `T` - the type the response will be transformed to

All Known Subinterfaces:
  `RestClient.RequestHeadersSpec.RequiredValueExchangeFunction<T>`

Enclosing interface:
  RestClient.RequestHeadersSpec<S extends RestClient.RequestHeadersSpec<S>>

Functional Interface:
  This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface RestClient.RequestHeadersSpec.ExchangeFunction<T>
Defines the contract for `RestClient.RequestHeadersSpec.exchange(ExchangeFunction)`.

## Method Summary

Modifier and Type
Method
Description
`T`
`exchange(HttpRequest clientRequest, RestClient.RequestHeadersSpec.ConvertibleClientHttpResponse clientResponse)`
Exchange the given response into a value of type `T`.

## Method Details

### exchange

@Nullable T exchange(HttpRequest clientRequest, RestClient.RequestHeadersSpec.ConvertibleClientHttpResponse clientResponse) throws IOException
Exchange the given response into a value of type `T`.

Parameters:
  `clientRequest` - the request
  `clientResponse` - the response
Returns:
  the exchanged value, potentially `null`
Throws:
  `IOException` - in case of I/O errors