title: Apache camel - REST client - response header not getting set. Want to handle response as JSON
body: <p>I am trying to invoke REST service with basic authentication, response needs to be handled in JSON. When I try the following, I still get response as xml:</p>
  
  <pre><code>&lt;bean id="httpAuth" class="org.apache.camel.component.http.HttpConfiguration"&gt;
  &lt;property name="authMethod" value="Basic"/&gt;
  &lt;property name="authUsername" value="users"/&gt;
  &lt;property name="authPassword" value="passwor"/&gt;
  &lt;/bean&gt;
  &lt;bean id="httpBind" class="org.apache.camel.component.http.DefaultHttpBinding"&gt;
  &lt;/bean&gt;
  &lt;bean id="httpHeaderFilter" class="org.apache.camel.impl.DefaultHeaderFilterStrategy"&gt;
  &lt;/bean&gt;
  &lt;bean id="http" class="org.apache.camel.component.http.HttpComponent"&gt;
  &lt;property name="camelContext" ref="mycontext"/&gt;
  &lt;property name="httpConfiguration" ref="httpAuth"/&gt;
  &lt;property name="httpBinding" ref="httpBind"/&gt;
  &lt;/bean&gt;
  .
  .
  &lt;camel:camelContext id="mycontext" xmlns="http://camel.apache.org/schema/spring" autoStartup="true" useMDCLogging="true" errorHandlerRef="ErrorHandler_xx"&gt;
  &lt;route id="myroute"&gt;
  &lt;from uri="http://urltorestresource?httpBindingRef=httpBind&amp;amp;headerFilterStrategy=httpHeaderFilter" /&gt;
  &lt;setHeader headerName="Accept"&gt;
  &lt;constant&gt;application/json&lt;/constant&gt;
  &lt;/setHeader&gt;
  &lt;setHeader headerName="Content-Type"&gt;
  &lt;constant&gt;application/json&lt;/constant&gt;
  &lt;/setHeader&gt;
  
  &lt;convertBodyTo type="String" charset="UTF-8" /&gt;
  &lt;to uri="file://archive?fileName=response.txt" /&gt; 
  
  &lt;/route&gt;
  &lt;/camel:camelContext&gt;
  </code></pre>