title: Setting Security cookie using RestTemplate
body: <p>I am trying to call a  Restful JSON service using RestTemplate and Jackson json convertor. Now in order to call the service I need to pass in a Security cookie. I can achieve this by using URLConnection (See the code below)</p>
  
  <pre><code>URL url= new URL("https://XXXXXXXX");
  
  URLConnection yc = url.openConnection();
  yc.setRequestProperty("SecurityCookie", ssocookie.getValue());&lt;/code&gt;
  </code></pre>
  
  <p>Whats the parallel for this in RestTemplate? Here is a code snippet which I have been using to call a Restful Service using RestTemplate:</p>
  
  <pre><code>RestTemplate rest = new RestTemplate();  
  InputBean input = new InputBean();  
  input.setResource("SampleResource");  
  HttpEntity&lt;InputBean &gt; entity = new HttpEntity&lt;InputBean&gt;(input);  
  ResponseEntity&lt;OutputBean&gt; response1 = rest.postForEntity(
      "https://XXXXXXXXX", 
      entity, OutputBean.class);&lt;/code&gt;
  </code></pre>
  
  <p>I can not figure out how to pass the security cookie while using RestTemplate to call the service. Any help on this would be great.</p>