23.17. 配置 charset
				如果您使用 POST 来发送数据,您可以使用 Exchange 属性配置 charset :
			
exchange.setProperty(Exchange.CHARSET_NAME, "ISO-8859-1");
exchange.setProperty(Exchange.CHARSET_NAME, "ISO-8859-1");23.17.1. 带有调度轮询的示例
复制链接链接已复制到粘贴板!
					这个示例每 10 秒轮询 Google 主页,并将页面写入文件 message.html :
				
from("timer://foo?fixedRate=true&delay=0&period=10000")
  .to("http://www.google.com")
  .setHeader(FileComponent.HEADER_FILE_NAME, "message.html")
  .to("file:target/google");
from("timer://foo?fixedRate=true&delay=0&period=10000")
  .to("http://www.google.com")
  .setHeader(FileComponent.HEADER_FILE_NAME, "message.html")
  .to("file:target/google");23.17.2. 端点 URI 中的 URI 参数
复制链接链接已复制到粘贴板!
					在本例中,我们有一个完整的 URI 端点,该端点只是您在 Web 浏览器中键入的内容。可以使用 和 字符作为分隔符来设置多个 URI 参数,就像您在 Web 浏览器中一样。Camel 在此处不做任何技巧。
				
// we query for Camel at the Google page
template.sendBody("http://www.google.com/search?q=Camel", null);
// we query for Camel at the Google page
template.sendBody("http://www.google.com/search?q=Camel", null);23.17.3. 来自消息的 URI 参数
复制链接链接已复制到粘贴板!
Map headers = new HashMap();
headers.put(Exchange.HTTP_QUERY, "q=Camel&lr=lang_en");
// we query for Camel and English language at Google
template.sendBody("http://www.google.com/search", null, headers);
Map headers = new HashMap();
headers.put(Exchange.HTTP_QUERY, "q=Camel&lr=lang_en");
// we query for Camel and English language at Google
template.sendBody("http://www.google.com/search", null, headers);
					在上面的标头值中,它不应 带有前缀 ?, 您可以像使用 & amp; char 那样分隔参数。
				
23.17.4. 获取响应代码
复制链接链接已复制到粘贴板!
					您可以通过 Exchange.HTTP_RESPONSE_CODE 从 Out 消息标头中获取 HTTP 响应代码。