title: Get HttpServletRequest and HttpServletResponse from Camel Message Body
body: <p>I'm trying to send a request to an HTTP endpoint using Camel Jetty or Camel HTTP component. I was wondering if it's possible to convert the request and response to HttpServletRequest and HttpServletResponse objects. </p>
  
  <p>I have the following route: </p>
  
  <pre><code>from("direct://processing/callEndpoint")
      .to("jetty:http://www.google.com")
      .to("bean:processHttpResponse")
  </code></pre>
  
  <p>I'm using Guice for dependency injection and <em>"bean:processHttpResponse"</em> is the following:</p>
  
  <pre><code>public class HttpResponseBean {
  
      public void processResponse(Exchange exchange) {
  
          HttpServletRequest request = exchange.getIn().getBody(HttpServletRequest.class);
          HttpServletResponse response = exchange.getOut().getBody(HttpServletResponse.class);
  
      }
  }
  </code></pre>
  
  <p>Both <em>request</em> and <em>response</em> objects are null. When debugging/inspecting the Exchange, the In Message is a byte array (byte[]) and the Out Message is null. Not sure how to proceed..</p>