3.12. http 메서드를 HTTP 생산자로 설정하는 방법

HTTP 구성 요소는 메시지 헤더를 설정하여 HTTP 요청 메서드를 설정하는 방법을 제공합니다. 예를 들면 다음과 같습니다.

from("direct:start")
            .setHeader(Exchange.HTTP_METHOD, constant("POST"))
        .to("ahc:http://www.google.com")
            .to("mock:results");

다음과 같은 Spring 샘플이 있습니다.

<camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
  <route>
    <from uri="direct:start"/>
    <setHeader headerName="CamelHttpMethod">
        <constant>POST</constant>
    </setHeader>
    <to uri="ahc:http://www.google.com"/>
    <to uri="mock:results"/>
  </route>
</camelContext>