camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From William Tam <email.w...@gmail.com>
Subject Re: restlet component GET request and query string parameters
Date Fri, 25 Mar 2011 20:15:33 GMT
The issue with setting queries in the request URI has been resolved.  
Please see https://issues.apache.org/jira/browse/CAMEL-3808

Regards.



On 03/18/2011 10:18 AM, mat127 wrote:
> Hello,
>
> I am using the camel-restlet component to build a REST client calling some
> 3rd party application RESTful API that is not built upon Camel.
>
> In some cases I need to provide parameters to GET requests like e.g. item id
> etc. According to the documentation and the source code I understood that
> the restlet component pushes all header fields into the restlet.org request
> (using the DefaultRestletBinding class). But I am unable to produce the
> desired request this way at all.
>
> Let me explain on following example:
>
> 	&lt;camel:route&gt;
>              &lt;camel:from uri="direct:test"/&gt;
>              &lt;camel:setHeader headerName="locale"&gt;
> 	&lt;camel:constant&gt;cs_CZ&lt;/camel:constant&gt;
>              &lt;/camel:setHeader&gt;
>              &lt;camel:to uri="restlet:http://localhost:8089/"/&gt;
>              ...
> 	&lt;/camel:route&gt;
>
> Calling this route using following Scala code:
>
> 	    producer.requestBodyAndHeader(
>      		"direct:test", "",
>      		"itemId", id.id,
>      		classOf[java.util.Map[String,Object]]
> 	    )
>
> will produce following HTTP request on the localhost:
>
> [pema@dev ~]$ nc -l 8089
> GET http://dev:8089/ HTTP/1.1
> Host: dev:8089
> User-Agent: Noelios-Restlet-Engine/1.1.10
> Referer: camel-restlet
> Accept: */*
> Connection: close
>
> The problem is that the 'locale' and the 'id' parameters are missing there.
> How can I get them into the GET request query string? Any hints are welcome!
>
> Regards, Petr
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/restlet-component-GET-request-and-query-string-parameters-tp3964973p3964973.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Mime
View raw message