private class RestTemplate.AcceptHeaderRequestCallback extends java.lang.Object implements RequestCallback
Modifier and Type | Field and Description |
---|---|
private java.lang.reflect.Type |
responseType |
Constructor and Description |
---|
AcceptHeaderRequestCallback(java.lang.reflect.Type responseType) |
Modifier and Type | Method and Description |
---|---|
private boolean |
canReadResponse(java.lang.reflect.Type responseType,
HttpMessageConverter<?> converter) |
void |
doWithRequest(ClientHttpRequest request)
|
private java.util.stream.Stream<MediaType> |
getSupportedMediaTypes(HttpMessageConverter<?> messageConverter) |
@Nullable private final java.lang.reflect.Type responseType
public AcceptHeaderRequestCallback(@Nullable java.lang.reflect.Type responseType)
public void doWithRequest(ClientHttpRequest request) throws java.io.IOException
RequestCallback
RestTemplate.execute(java.lang.String, org.springframework.http.HttpMethod, org.springframework.web.client.RequestCallback, org.springframework.web.client.ResponseExtractor<T>, java.lang.Object...)
with an opened ClientHttpRequest
.
Does not need to care about closing the request or about handling errors:
this will all be handled by the RestTemplate
.doWithRequest
in interface RequestCallback
request
- the active HTTP requestjava.io.IOException
- in case of I/O errorsprivate boolean canReadResponse(java.lang.reflect.Type responseType, HttpMessageConverter<?> converter)
private java.util.stream.Stream<MediaType> getSupportedMediaTypes(HttpMessageConverter<?> messageConverter)