通过 Exchange.CONTENT_TYPE 设置 header Content-Type 和通常设置 Content-Type 有什么区别?
What is the difference between setting the header Content-Type through Exchange.CONTENT_TYPE and usually Content-Type?
我可以设置headerContent-Type所以
<setHeader headerName="Exchange.CONTENT_TYPE">
<constant>application/json</constant>
</setHeader>
等等
<setHeader headerName="Content-Type">
<constant>application/json</constant>
</setHeader>
这两种方法有什么区别?哪种方法可能有问题?
这是一回事。 Exchange.CONTENT_TYPE
是一个引用字符串 "Content-Type" 的常量,在内部被 Camel 替换。
我可以设置headerContent-Type所以
<setHeader headerName="Exchange.CONTENT_TYPE">
<constant>application/json</constant>
</setHeader>
等等
<setHeader headerName="Content-Type">
<constant>application/json</constant>
</setHeader>
这两种方法有什么区别?哪种方法可能有问题?
这是一回事。 Exchange.CONTENT_TYPE
是一个引用字符串 "Content-Type" 的常量,在内部被 Camel 替换。