如何设置使用Camel中的http4组件发出的请求的头部?我要连接的站点需要设置referrer标头。直接使用HttpClient,可以向请求添加头部,但我看不出这在Camel中是如何公开的。
ETA:基于已接受答案的工作示例:
from("timer://foo?fixedRate=true&delay=0&period=300000")
.setHeader("Referer", constant("https://example.com"))
.to("https4://www.example.com")发布于 2013-06-14 23:50:09
您应该能够将其设置为Camel路由中的标头(如果您使用它的话)
setHeader("referrer", constant("MyValue"))尽管您的问题有点含糊,但如何使用Camel http4组件发送请求。
https://stackoverflow.com/questions/17088722
复制相似问题