There are two character of ?.
Can you change the recipientList to
.recipientList(simple("${body}&authMethod=Basic&authUsername=user&authPassword=pass")
--
Willem Jiang
Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/)
(English)
http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem
On Thursday, July 18, 2013 at 4:35 PM, humayun0156 wrote:
> Hi,
> I've an url with query parameters which is dynamically generated. i don't
> know how many parameters there are. i want to hit the url and get the body.
> say my url looks like : http://myhost.com?name=xxx&id=yyy
> it needs basic authentication.
> so i request
> Object object = producerTemplate.requestBody("direct:get", url);
>
> and my route is :
> from("direct:epGet")
> .setHeader(Exchange.HTTP_METHOD, constant("GET"))
>
> .recipientList(simple("${body}?authMethod=Basic&authUsername=user&authPassword=pass"));
>
> but when i run there is an error.
> The exchange message body is set correctly
> Endpoint[direct://epGet] Exchange[Message:
> http://myhost.com?name=xxx&id=yyy]
>
> but it creates the following endPoint which is not correct.
> DEBUG DefaultComponent:117 - Creating endpoint
> uri=[http://myhost.com?authPassword=******&authUsername=user&id=yyy&name=xxx%3FauthMethod%3DBasic],
> path=[myhost.com (http://myhost.com)]
>
> to resolve this query param what should i do? any idea?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Work-with-Exchange-HTTP-QUERY-tp5735839.html
> Sent from the Camel - Users mailing list archive at Nabble.com
> (http://Nabble.com).