我試圖通過使用camel-http的Apache Camel發送http調用。Apache Camel HTTP/HTTP4忽略內容類型標頭
當我設置標題Content-Type時,它將忽略標題並且不會將其包含在調用中。
我已經嘗試設置頭具有如下:
exchange.getOut().setHeader('Content-Type', 'application/json'),
和
exchange.getOut().setHeader(Exchange.CONTENT_TYPE, 'application/json');
我一直在使用也嘗試駱駝HTTP和駱駝http4,它不與任何人一起工作。
因爲我必須強制發送Content-Type標頭,我該如何強制Camel-HTTP包含它?
注:我還設置其他頭被正確地發送呼叫以同樣的方式,它只是在Content-Type的一個不工作
你見過這個討論嗎? http://camel.465427.n5.nabble.com/Http4-Set-Header-Content-Type-not-passing-through-to-the-HTTP-Request-td5746414.html – Sergey 2015-04-01 15:29:34
作爲一種解決方法,將主體設置爲一個空的json文檔camel-http自動檢測內容類型是application/json並設置正確的Content-Type頭。 – 2015-04-05 01:15:11