camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: camel-http: Multiple Request Paramaters
Date Fri, 29 Jul 2011 06:11:23 GMT
If the Map.toString() supports to generate a right query string, I think 
you don't need to change other part camel code.

On 7/29/11 5:04 AM, daveharris wrote:
> Hi Claus,
> Thanks for the reply.
>
> For anyone else searching for the solution, I ended up using a processor to
> use a javax.ws.rs.core.UriBuilder in jdk6.  My main aim was to get a
> solution where I didn't have to write the ? and&  which is very brittle.
>
> .process(new Processor() {
>    public void process(Exchange exchange) throws Exception {
>      Message in = exchange.getIn();
>
>      javax.ws.rs.core.UriBuilder uriBuilder =
> javax.ws.rs.core.UriBuilder.fromUri("http://localhost");
>      uriBuilder.queryParam("app", in.getHeader(APPLICATION, String.class));
>      uriBuilder.queryParam("from", in.getHeader(FROM, String.class));
>      uriBuilder.queryParam("to", in.getHeader(TO, String.class));
>      uriBuilder.queryParam("msg", in.getBody(String.class));
>
>      in.setHeader(Exchange.HTTP_QUERY, uriBuilder.build().getRawQuery());
>    }
> })
>
> This works but it would be really nice to be able to provide a map ie.
> in.setHeader(Exchange.HTTP_QUERY, Map&lt;String, String&gt;).
>
> I would be happy to have a go at implementing this, unless anyone has any
> objections.
>
> Dave
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/camel-http-Multiple-Request-Paramaters-tp4641050p4644228.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang

Mime
View raw message