public class HttpMessageHandlerSpec extends MessageHandlerSpec<HttpMessageHandlerSpec,HttpRequestExecutingMessageHandler> implements ComponentsRegistration
MessageHandlerSpec implementation for the HttpRequestExecutingMessageHandler.HttpRequestExecutingMessageHandlerlogger, PARSER, target| Modifier and Type | Method and Description |
|---|---|
HttpMessageHandlerSpec |
charset(String charset)
Specify the charset name to use for converting String-typed payloads to bytes.
|
HttpMessageHandlerSpec |
encodeUri(boolean encodeUri)
Specify whether the real URI should be encoded after
uriVariables
expanding and before send request via RestTemplate. |
HttpMessageHandlerSpec |
errorHandler(ResponseErrorHandler errorHandler)
Set the
ResponseErrorHandler for the underlying RestTemplate. |
HttpMessageHandlerSpec |
expectedResponseType(Class<?> expectedResponseType)
Specify the expected response type for the REST request.
|
HttpMessageHandlerSpec |
expectedResponseType(ParameterizedTypeReference<?> expectedResponseType)
Specify a
ParameterizedTypeReference for the expected response type for the REST request. |
HttpMessageHandlerSpec |
expectedResponseTypeExpression(Expression expectedResponseTypeExpression)
Specify a SpEL
Expression to determine the type for the expected response
The returned value of the expression could be an instance of Class or
String representing a fully qualified class name. |
<P> HttpMessageHandlerSpec |
expectedResponseTypeFunction(java.util.function.Function<Message<P>,?> expectedResponseTypeFunction)
|
HttpMessageHandlerSpec |
extractPayload(boolean extractPayload)
Specify whether the outbound message's payload should be extracted
when preparing the request body.
|
Collection<Object> |
getComponentsToRegister() |
HttpMessageHandlerSpec |
headerMapper(HeaderMapper<HttpHeaders> headerMapper)
Set the
HeaderMapper to use when mapping between HTTP headers and MessageHeaders. |
HttpMessageHandlerSpec |
httpMethod(HttpMethod httpMethod)
Specify the
HttpMethod for requests. |
HttpMessageHandlerSpec |
httpMethodExpression(Expression httpMethodExpression)
Specify the SpEL
Expression to determine HttpMethod at runtime. |
<P> HttpMessageHandlerSpec |
httpMethodFunction(java.util.function.Function<Message<P>,?> httpMethodFunction)
Specify a
Function to determine HttpMethod at runtime. |
HttpMessageHandlerSpec |
mappedRequestHeaders(String... patterns)
Provide the pattern array for request headers to map.
|
HttpMessageHandlerSpec |
mappedResponseHeaders(String... patterns)
Provide the pattern array for response headers to map.
|
HttpMessageHandlerSpec |
messageConverters(HttpMessageConverter<?>... messageConverters)
Set a list of
HttpMessageConverters to be used by the underlying RestTemplate. |
HttpMessageHandlerSpec |
requestFactory(ClientHttpRequestFactory requestFactory)
Set the
ClientHttpRequestFactory for the underlying RestTemplate. |
HttpMessageHandlerSpec |
transferCookies(boolean transferCookies)
Set to
true if you wish Set-Cookie header in response to be
transferred as Cookie header in subsequent interaction for a message. |
HttpMessageHandlerSpec |
uriVariable(String variable,
Expression value)
Specify a SpEL expression to evaluate a value for the uri template variable.
|
<P> HttpMessageHandlerSpec |
uriVariable(String variable,
java.util.function.Function<Message<P>,?> valueFunction)
Specify a
Function to evaluate a value for the uri template variable. |
HttpMessageHandlerSpec |
uriVariable(String variable,
String value)
Specify a value for the uri template variable.
|
HttpMessageHandlerSpec |
uriVariableExpressions(Map<String,Expression> uriVariableExpressions)
Set the Map of URI variable expressions to evaluate against the outbound message
when replacing the variable placeholders in a URI template.
|
HttpMessageHandlerSpec |
uriVariablesExpression(Expression uriVariablesExpression)
Specify a SpEL expression to evaluate a
Map of URI variables at runtime against request message. |
HttpMessageHandlerSpec |
uriVariablesExpression(String uriVariablesExpression)
Specify a SpEL expression to evaluate a
Map of URI variables at runtime against request message. |
<P> HttpMessageHandlerSpec |
uriVariablesFunction(java.util.function.Function<Message<P>,Map<String,?>> uriVariablesFunction)
|
_this, doGet, get, getId, getObject, getObjectType, id, isSingletonpublic HttpMessageHandlerSpec encodeUri(boolean encodeUri)
uriVariables
expanding and before send request via RestTemplate. The default value is true.encodeUri - true if the URI should be encoded.public HttpMessageHandlerSpec httpMethodExpression(Expression httpMethodExpression)
Expression to determine HttpMethod at runtime.httpMethodExpression - The method expression.public <P> HttpMessageHandlerSpec httpMethodFunction(java.util.function.Function<Message<P>,?> httpMethodFunction)
Function to determine HttpMethod at runtime.P - the payload type.httpMethodFunction - The HTTP method Function.public HttpMessageHandlerSpec httpMethod(HttpMethod httpMethod)
HttpMethod for requests.
The default method is POST.httpMethod - the HttpMethod to use.public HttpMessageHandlerSpec extractPayload(boolean extractPayload)
true.extractPayload - true if the payload should be extracted.public HttpMessageHandlerSpec charset(String charset)
UTF-8.charset - The charset.public HttpMessageHandlerSpec expectedResponseType(Class<?> expectedResponseType)
expectedResponseType - The expected type.public HttpMessageHandlerSpec expectedResponseType(ParameterizedTypeReference<?> expectedResponseType)
ParameterizedTypeReference for the expected response type for the REST request.expectedResponseType - The ParameterizedTypeReference for expected type.public HttpMessageHandlerSpec expectedResponseTypeExpression(Expression expectedResponseTypeExpression)
Expression to determine the type for the expected response
The returned value of the expression could be an instance of Class or
String representing a fully qualified class name.expectedResponseTypeExpression - The expected response type expression.public <P> HttpMessageHandlerSpec expectedResponseTypeFunction(java.util.function.Function<Message<P>,?> expectedResponseTypeFunction)
Function to determine the type for the expected response
The returned value of the expression could be an instance of Class or
String representing a fully qualified class name.P - the payload type.expectedResponseTypeFunction - The expected response type Function.public HttpMessageHandlerSpec errorHandler(ResponseErrorHandler errorHandler)
ResponseErrorHandler for the underlying RestTemplate.errorHandler - The error handler.public HttpMessageHandlerSpec messageConverters(HttpMessageConverter<?>... messageConverters)
HttpMessageConverters to be used by the underlying RestTemplate.
Converters configured via this method will override the default converters.messageConverters - The message converters.public HttpMessageHandlerSpec requestFactory(ClientHttpRequestFactory requestFactory)
ClientHttpRequestFactory for the underlying RestTemplate.requestFactory - The request factory.public HttpMessageHandlerSpec headerMapper(HeaderMapper<HttpHeaders> headerMapper)
HeaderMapper to use when mapping between HTTP headers and MessageHeaders.headerMapper - The header mapper.public HttpMessageHandlerSpec mappedRequestHeaders(String... patterns)
patterns - the patterns for request headers to map.DefaultHttpHeaderMapper.setOutboundHeaderNames(String[])public HttpMessageHandlerSpec mappedResponseHeaders(String... patterns)
patterns - the patterns for response headers to map.DefaultHttpHeaderMapper.setInboundHeaderNames(String[])public HttpMessageHandlerSpec uriVariableExpressions(Map<String,Expression> uriVariableExpressions)
uriVariableExpressions - The URI variable expressions.HttpRequestExecutingMessageHandler.setUriVariableExpressions(Map)public HttpMessageHandlerSpec uriVariable(String variable, Expression value)
variable - the uri template variable.value - the expression to evaluate value for te uri template variable.HttpRequestExecutingMessageHandler.setUriVariableExpressions(Map)public HttpMessageHandlerSpec uriVariable(String variable, String value)
variable - the uri template variable.value - the expression to evaluate value for te uri template variable.HttpRequestExecutingMessageHandler.setUriVariableExpressions(Map)public <P> HttpMessageHandlerSpec uriVariable(String variable, java.util.function.Function<Message<P>,?> valueFunction)
Function to evaluate a value for the uri template variable.P - the payload type.variable - the uri template variable.valueFunction - the Function to evaluate a value for the uri template variable.HttpRequestExecutingMessageHandler.setUriVariableExpressions(Map)public HttpMessageHandlerSpec uriVariablesExpression(String uriVariablesExpression)
Map of URI variables at runtime against request message.uriVariablesExpression - to use.HttpRequestExecutingMessageHandler.setUriVariablesExpression(Expression)public HttpMessageHandlerSpec uriVariablesExpression(Expression uriVariablesExpression)
Map of URI variables at runtime against request message.uriVariablesExpression - to use.HttpRequestExecutingMessageHandler.setUriVariablesExpression(Expression)public <P> HttpMessageHandlerSpec uriVariablesFunction(java.util.function.Function<Message<P>,Map<String,?>> uriVariablesFunction)
P - the payload type.uriVariablesFunction - the Function to use.HttpRequestExecutingMessageHandler.setUriVariablesExpression(Expression)public HttpMessageHandlerSpec transferCookies(boolean transferCookies)
true if you wish Set-Cookie header in response to be
transferred as Cookie header in subsequent interaction for a message.transferCookies - the transferCookies to set.public Collection<Object> getComponentsToRegister()
getComponentsToRegister in interface ComponentsRegistration