阻止Apache AHC向请求添加“ transfer-encoding:chunked”标头

时间:2019-12-09 16:03:45

标签: apache-camel cxf

我需要调用由https://login.microsoftonline.com托管的登录API

我正在使用Apache AHC v2.1,它会自动向所有请求添加http标头“ transfer-encoding:chunked”。

API不支持传输编码和返回。

**Not Implemented**

HTTP Error 501. The request transfer encoding type is not supported.

如何防止AHC添加此标头?

我尝试使用推荐的@推荐的“ removeHeaders”选项

https://camel.apache.org/manual/latest/faq/how-to-avoid-sending-some-or-all-message-headers.html

但这不会删除此标头。

任何帮助表示赞赏。

1 个答案:

答案 0 :(得分:0)

如果您改用Apache Camel HTTP component,则可以禁用设置 分块

此设置在 AHC 组件上不可用。