You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Gunjara <mg...@gmail.com> on 2016/10/12 08:28:09 UTC

How to consume remote rest url and how to write given json response in a text file.

Hi Any Body can help me on this.

How to consume remote rest url and how to write given json response in a
text file.

like have Order ,Price endpoint urls are there i need to consume those urls
,take that into pojo and generated json in a text file.


Regards,
Gunjara





--
View this message in context: http://camel.465427.n5.nabble.com/How-to-consume-remote-rest-url-and-how-to-write-given-json-response-in-a-text-file-tp5788666.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to consume remote rest url and how to write given json response in a text file.

Posted by Tomohisa Igarashi <tm...@gmail.com>.
You can pass the HTTP parameters dynamically via Exchange.HTTP_QUERY message header.
http://camel.apache.org/http.html

On 10/12/2016 09:55 PM, Gunjara wrote:
> Hi Tomohisa Igarashi, Thanks for your reply.
> I need to pass parameters dynamically like
> http://yourhost.domain/path/to/rest/resource/productid=1234&date=10122016 .
> How I can do that , please help me . If you have any sample git code plz
> send me.
>
> Regards,
> Gunjara
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-consume-remote-rest-url-and-how-to-write-given-json-response-in-a-text-file-tp5788666p5788686.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

RE: How to consume remote rest url and how to write given json response in a text file.

Posted by "Goyal, Arpit" <ar...@sap.com>.
See this FAQ about dynamic to
http://camel.apache.org/how-to-use-a-dynamic-uri-in-to.html 

Clause pointed out recently. We used 'toD' from 2.16.3 version and tested camel-http component which works. 

So the dynamic part like product id or date could be headers, properties etc set by processor before toD and in the URL you could have productid=${header.pid}&date=${header.pdate}

Regards,
Arpit.

-----Original Message-----
From: Gunjara [mailto:mgunjara.galaxe@gmail.com] 
Sent: Wednesday, October 12, 2016 5:56 AM
To: users@camel.apache.org
Subject: Re: How to consume remote rest url and how to write given json response in a text file.

Hi Tomohisa Igarashi, Thanks for your reply.
I need to pass parameters dynamically like
http://yourhost.domain/path/to/rest/resource/productid=1234&date=10122016 .
How I can do that , please help me . If you have any sample git code plz
send me.

Regards,
Gunjara
 



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-consume-remote-rest-url-and-how-to-write-given-json-response-in-a-text-file-tp5788666p5788686.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to consume remote rest url and how to write given json response in a text file.

Posted by Gunjara <mg...@gmail.com>.
Hi Tomohisa Igarashi, Thanks for your reply.
I need to pass parameters dynamically like
http://yourhost.domain/path/to/rest/resource/productid=1234&date=10122016 .
How I can do that , please help me . If you have any sample git code plz
send me.

Regards,
Gunjara
 



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-consume-remote-rest-url-and-how-to-write-given-json-response-in-a-text-file-tp5788666p5788686.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to consume remote rest url and how to write given json response in a text file.

Posted by Tomohisa Igarashi <tm...@gmail.com>.
Is .to("http://yourhost.domain/path/to/rest/resource").to("file:outputDir") insufficient for you?

On 10/12/2016 05:28 PM, Gunjara wrote:
> Hi Any Body can help me on this.
>
> How to consume remote rest url and how to write given json response in a
> text file.
>
> like have Order ,Price endpoint urls are there i need to consume those urls
> ,take that into pojo and generated json in a text file.
>
>
> Regards,
> Gunjara
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-consume-remote-rest-url-and-how-to-write-given-json-response-in-a-text-file-tp5788666.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>