Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^4: Paging with REST::Client?

by Argel (Prior)
on Jan 13, 2020 at 17:25 UTC ( [id://11111364]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Paging with REST::Client?
in thread Paging with REST::Client?

Sorry, I should have been clear -- that's an example from my old Curl code. REST::Client isn't doing any of the paging.

Elda Taluta; Sarks Sark; Ark Arks
My deviantART gallery

Replies are listed 'Best First'.
Re^5: Paging with REST::Client?
by 1nickt (Canon) on Jan 13, 2020 at 17:54 UTC

    Umm, right. Rest::Client does not do any paging. You said that it's on the server. So that means that you will have to provide the parameters or headers necessary to Rest::Client in the call it makes, and write a wrapper that collates the results from the various requests.

    What does the documentation of the API you are calling say about paging?


    The way forward always starts with a minimal test.
      The only documentation is an example in an appendix. I've used it with with Perl code shelling out to Curl, so I can go back to it if necessary. But that was really ugly code and I don't have time to write something prettier. I was really hoping this came up enough that an existing module supported it, or e.g. that LWP::UserAgent had the hooks in it to add support for it. Sort of like how XML::Twig has an option to iterate over large XML files.

      It seems like the easiest approach may be to see if I can tell that there was an error because of too much data, and if so, I can assume a restart is needed. Thanks for the help!

      Elda Taluta; Sarks Sark; Ark Arks
      My deviantART gallery

        The only documentation is an example in an appendix.

        Where can one read that documentation?

        I was really hoping this came up enough that an existing module supported it, or e.g. that LWP::UserAgent had the hooks in it to add support for it.

        Sorry but you still haven't explained the problem, what are you talking about?

        "Paging" is just looping. https://metacpan.org/release/REST-Client/source/lib/REST/Client.pm is a thin wrapper around LWP, and LWP has plenty of hooks.

        Its like a delivery driver asking a car mechanic, does my car have paging? Can you add a paging module?

        Dear delivery driver, you are the pager :) You drive for pickup, you drive for delivery, repeat, ...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11111364]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-19 21:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found