You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Calle Andersson <ca...@hotmail.com> on 2021/08/24 16:31:49 UTC

Re: Unable to set Content-Type HTTP header to custom value

I finally found a solution to my problem. It turned out 'contentTypeHeader' could be set to 'false' in the following simple way:
restConfiguration().dataFormatProperty("contentTypeHeader", "false")...

Now I am able to return responses with custom Content-Type values.


Re: Unable to set Content-Type HTTP header to custom value

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Aug 24, 2021 at 6:32 PM Calle Andersson
<ca...@hotmail.com> wrote:
>
> I finally found a solution to my problem. It turned out 'contentTypeHeader' could be set to 'false' in the following simple way:
> restConfiguration().dataFormatProperty("contentTypeHeader", "false")...
>
> Now I am able to return responses with custom Content-Type values.
>

Thanks for sharing the solution.

You are welcome to help improve the rest-dsl documentation page (click
edit this page) and add a section covering this use-case and how to
turn that off.


-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2