Samy
Samy

Reputation: 2517

Content-Type in GET method not getting populated

Setting Content-Type for GET method is not getting populated using Apache Camel-Http component.

exchange.getIn().setHeader(Exchange.CONTENT_TYPE, "application/json");

Whereas the same is working when using POST method.

Understood that there is no body for method GET. A strange thing is, if body is set to empty string("") Content-Type is being passed but the method type also changes to POST.

exchange.getIn().setBody("");

2.13.1 is the Camel version that i am currently using. Tried with the latest versions too, still the same. Is there something that i am missing.

Service mandates to pass Content-Type.

Upvotes: 1

Views: 1211

Answers (1)

Related Questions