Risk-Aware Code Review: Auto Approve Low-Risk Changes
LiveReview LiveReview LiveReview - Free, Risk-Aware Code Review: Auto Approve Low-Risk Changes | Product Hunt LiveReview - Free, Risk-Aware Code Review: Auto Approve Low-Risk Changes | Product Hunt GitHub Install Now

We'd appreciate a star

WWW::Shorten::UserAgent - LWP::UserAgent subclass for WWW::Shorten modules.

Author

       Dave Cross <dave@mag-sol.com>

Description

       Subclass of LWP::UserAgent which works the same way as the superclass except that it throws an exception
       if the "get" or "post" method returns an error.

       See LWP::UserAgent for the full documentation.

Methods

get
       Makes an HTTP GET request and throws an exception on error.

   post
       Makes an HTTP POST request and throws an exception on error.

Name

       WWW::Shorten::UserAgent - LWP::UserAgent subclass for WWW::Shorten modules.

See Also

       WWW::Shorten

perl v5.36.0                                       2022-11-19                       WWW::Shorten::UserAgent(3pm)

Synopsis

         use strict;
         use warnings;
         use WWW::Shorten::UserAgent;
         use Try::Tiny qw(try catch);

         my $ua = WWW::Shorten::UserAgent->new;

         my $resp = try {
           $ua->get($url);
         }
         catch {
           warn "Uh oh: $_";
           return undef;
         };

See Also