Content-Type is not supported in Camel DELETE method?

后端 未结 3 515
傲寒
傲寒 2021-01-26 15:59

How do i send content-type in Camel DELETE method. I have added the following way but It was not working correctly.

from(\"direct:start\")
.setHeader(Exchange.H         


        
3条回答
  •  孤街浪徒
    2021-01-26 16:35

    Content-type/body content is supported in apache camel through producer template with query param "deleteWithBody" by default it will be false.

    String endpoint = https://testuri.com/resource;
    endpoint = https://testuri.com/resource?deleteWithBody=true;
    Exchange exchange;
    exchange.getIn.setBody("test");
    exchange.getIn.setHeader("Content-Type","application/json");
    ProducerTemplate template = exchange.set(endpoint, exchange);
    

提交回复
热议问题