gpt4 book ai didi

spring-integration - http-outbound-gateway 设置了错误的内容类型 header

转载 作者:行者123 更新时间:2023-12-01 14:40:42 33 4
gpt4 key购买 nike

我们从 SIv3.x 迁移到 SIv4.0.4,发现现在 http-outbound-gateway 设置了错误的内容类型 header 。它不是像这种内容类型那样设置它,而是像 contentType 那样设置它。四处搜索我发现这可能是因为现在 SI 使用 Spring Messaging 类,其中此属性被命名为 contentType。

public static final String CONTENT_TYPE = "contentType";

有没有办法在 http-outbound 中或在使用 object-to-json-transformer 之前正确设置此内容类型?

提前致谢问候古兹曼

最佳答案

好吧,我明白你的意思,这确实是一个错误,我们在迁移到 Spring Messaging 时错过了它。

请提出 JIRA关于机票的事-和我们来图contentType邮件标题到 Content-Type HTTP header 。

现在作为解决方法,您可以 re-map手动:

<header-enricher>
<header name="#{T(org.springframework.http.HttpHeaders).CONTENT_TYPE}" expression="headers[#{T(org.springframework.messaging.MessageHeaders).CONTENT_TYPE}]"/>
</header-enricher>

而不是在 <obeject-to-json-transformer> 之前, 但在 <int-http:outbound-gateway> 之后和之前

关于spring-integration - http-outbound-gateway 设置了错误的内容类型 header ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25557398/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com