Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Perl equivalent for Python's request module for REST APIs.

by Anonymous Monk
on Sep 24, 2021 at 22:45 UTC ( #11137003=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

Is there an equivalent of the "request" Python module in Perl? The only similar module I see is Rest:: Client, but it hasn't been updated since 2015.

  • Comment on Perl equivalent for Python's request module for REST APIs.

Replies are listed 'Best First'.
Re: Perl equivalent for Python's request module for REST APIs.
by hippo (Bishop) on Sep 25, 2021 at 08:46 UTC
    The only similar module I see is Rest:: Client, but it hasn't been updated since 2015.

    REST::Client is a module for making requests to REST API servers. It is stable and solid which is why it has not needed any recent updates.


    🦛

Re: Perl equivalent for Python's request module for REST APIs.
by Fletch (Chancellor) on Sep 24, 2021 at 23:40 UTC

    Prossibly not exactly what you're looking for but the Mojolicious web framework comes with a pretty spiffy set of client functionality. Look at Mojo::UserAgent (and the mojo docs) and see if that might scratch your itch.

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

Re: Perl equivalent for Python's request module for REST APIs.
by LanX (Sage) on Sep 25, 2021 at 01:30 UTC

      ... or HTTP::Tiny, which has been in core since 5.13.9. Of course, if you are using one of those *nix systems where the downstream packagers know better than p5p what ought to be in core, you may still not have it.

        Wow, thanks for mentioning that! I had never noticed it was in the core.

        return on_success() or die;

      I agree.

      Although the TIMTOWTDI principle applies here as in almost everything regarding Perl, I'd say most of the times you want to interact with the Web in Perl, you'd go with LWP.

      return on_success() or die;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2021-12-02 09:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (18 votes). Check out past polls.

    Notices?