Hi

What version of Camel are you using?

Usually you add parameters to GET using { } placeholders.

/foo/bar/{id}

And then provide id as a header with the value.



On Fri, Mar 18, 2011 at 3:18 PM, mat127 <p3tr.matou...@gmail.com> 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.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to