How to dynamically update URL in GetHTTP processor ?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to dynamically update URL in GetHTTP processor ?

shweta
Hi All,

I have a requirement wherein I have to update  getHTTP URL dynamically. Within that url I have
a parameter called page whose value can vary from 1 to N number depending upon no. of pages present.

My requirement is as such that  "nextInt()" would not be useful. I want to define my own parameter like page.counter and increment it by 1 based on some condition. For example in following URL page=1

https://api.stackexchange.com/2.2/posts?page=1&fromdate=1450224000&todate=1450310400&order=desc&sort=activity&site=stackoverflow

I want to dynamically update page no. and fetch the result.

Any pointers would be useful.

Thanks,
Shweta
Reply | Threaded
Open this post in threaded view
|

Re: How to dynamically update URL in GetHTTP processor ?

Brandon DeVries
Shweta,

     Take a look at InvokeHTTP[1] instead of GetHTTP.  InvokeHTTP allows
Expression Language in the URL, so you can specify the page number.  Let us
know if you have any other questions.  Thanks.

[1]
http://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi.processors.standard.InvokeHTTP/index.html

Brandon

On Thu, Dec 17, 2015 at 4:13 AM, shweta <[hidden email]> wrote:

> Hi All,
>
> I have a requirement wherein I have to update  getHTTP URL dynamically.
> Within that url I have
> a parameter called page whose value can vary from 1 to N number depending
> upon no. of pages present.
>
> My requirement is as such that  "nextInt()" would not be useful. I want to
> define my own parameter like page.counter and increment it by 1 based on
> some condition. For example in following URL page=1
>
>
> https://api.stackexchange.com/2.2/posts?*page=1*&fromdate=1450224000&todate=1450310400&order=desc&sort=activity&site=stackoverflow
>
> I want to dynamically update page no. and fetch the result.
>
> Any pointers would be useful.
>
> Thanks,
> Shweta
>
>
>
>
> --
> View this message in context:
> http://apache-nifi-developer-list.39713.n7.nabble.com/How-to-dynamically-update-URL-in-GetHTTP-processor-tp5826.html
> Sent from the Apache NiFi Developer List mailing list archive at
> Nabble.com.
>