我正在尝试从 http 出站网关发送此字符串“de caisse a été enregistr***é*** ”。此字符串包含法语字符(é)。我收到一个错误,响应代码为 400(错误请求)
但是,当我在 Rest Easy 客户端框架中尝试相同的操作时,我得到了成功代码(200)。
我的 Spring 集成配置中是否缺少某些内容? ?
共享配置
<int-http:outbound-gateway id="xtifygateway"
request-channel="xtifyrequestchannel" request-factory="requestFactory"
url="${xtifyUrl}" http-method="POST">
</int-http:outbound-gateway>
<int:header-enricher input-channel="requestchannel"
output-channel="xtifyrequestchannel">
<int:header
name="Content-Type"
value="application/json"/>
</int:header-enricher
<bean id="requestFactory"
class="org.springframework.http.client.SimpleClientHttpRequestFactory">
<property name="connectTimeout" value="${timeout}" />
<property name="readTimeout" value="${timeout}" />
</bean>
最佳答案
您应该尝试设置字符集
<int-http:outbound-gateway id="xtifygateway"
request-channel="xtifyrequestchannel" request-factory="requestFactory" charset="UTF-8"
url="${xtifyUrl}" http-method="POST">
</int-http:outbound-gateway>
关于java - spring-integration http 出站网关不支持 é 等法语字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36647644/