Net::HTTPS::Any(3pm)

πŸ“¦
version 0.12 Β· 2 versions
  • 0.12 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.12 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ Net::HTTPS::Any ✨

okay bestie, so this is Net::HTTPS::Any β€” a Simple HTTPS client πŸ’… and yes it's a Perl module, and yes it's from the User Contributed Perl Documentation, and yes we're gonna get into it.


🌸 SYNOPSIS 🌸

  use Net::HTTPS::Any qw(https_get https_post);

  ( $page, $response, %reply_headers )
      = https_get(
                   { 'host' => 'www.fortify.net',
                     'port' => 443,
                     'path' => '/sslcheck.html',
                     'args' => { 'field' => 'value' },
                     #'args' => [ 'field'=>'value' ], #order preserved
                   },
                 );

  ( $page, $response, %reply_headers )
      = https_post(
                    'host' => 'www.google.com',
                    'port' => 443,
                    'path' => '/accounts/ServiceLoginAuth',
                    'args' => { 'field' => 'value' },
                    #'args' => [ 'field'=>'value' ], #order preserved
                  );

  #...

like. look at that. so clean. so iconic. πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

So what even is this? It's a wrapper around Net::SSLeay that gives you a simple interface for the use of Business::OnlinePayment. that's the whole vibe. no cap. πŸ”₯

Now, real talk: it used to let you switch between the Net::SSLeay and Crypt::SSLeay implementations, but that got obsoleted β€” it's gone, bestie, it's not coming back. If you genuinely need to do that switching thing, use LWP instead. periodt.

BUT β€” and this is the little loophole 🫢 β€” you can set $Net::HTTPS::SSL_SOCKET_CLASS = "Net::SSL" to get Crypt::SSLeay instead of the default Net::SSLeay. That's been a thing since 6.02. noted. πŸ’–


πŸ‘‘ FUNCTIONS πŸ‘‘

🌈 https_get HASHREF | FIELD => VALUE, ...

It takes parameters either as a hashref or as a list of fields and values. either one, she's flexible like that. πŸ’…

The parameters are:

  • host β€” the host, babe.
  • port β€” the port.
  • path β€” the path.
  • headers (hashref) β€” the headers. For example: { 'X-Header1' => 'value', ... }
  • args β€” CGI arguments, either as a hashref or a listref. If you go with a listref, ordering is preserved (peep Tie::IxHash if you wanna keep that order while passing a hashref).
  • debug β€” set it true to enable debugging. πŸ‘€

What does it give you back? A list, consisting of:

  1. the page content, as a string πŸ“„
  2. the HTTP response code and message (i.e. "200 OK" or "404 Not Found")
  3. a list of key/value pairs representing the HTTP response headers

three things. gorgeous. slay. ✨

πŸ’œ https_post HASHREF | FIELD => VALUE, ...

Same deal β€” parameters as either a hashref or a list of fields and values.

The parameters are:

  • host β€” the host, again.
  • port β€” the port, again.
  • path β€” the path, again.
  • headers (hashref) β€” the headers. For example: { 'X-Header1' => 'value', ... }
  • Content-Type β€” defaults to application/x-www-form-urlencoded if you don't specify it. don't come for me, that's just the default. πŸ’…
  • args β€” CGI arguments, either as a hashref or a listref. listref = ordering is preserved (again, see Tie::IxHash for doing that with a hashref).
  • content β€” raw content, and it overrides args. just a simple scalar holding the raw content.
  • debug β€” set it true to enable debugging in the underlying SSL module. πŸ”

And the return? Same list energy:

  1. the page content, as a string πŸ“„
  2. the HTTP response code and message (i.e. "200 OK" or "404 Not Found")
  3. a list of key/value pairs representing the HTTP response headers

ate. no crumbs. πŸ“


🧚 AUTHOR 🧚

Ivan Kohler, "<ivan-net-https-any at freeside.biz>" β€” king behavior, honestly. πŸ‘‘


πŸ’€ BUGS πŸ’€

Found a bug? Want a feature? Please report it to "bug-net-https-any at rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-HTTPS-Any>.

Here's the deal: he gets notified, and then you'll automatically get notified of progress on your bug as he makes changes. mutual. reciprocal. we love to see it. 🫢

πŸŽ€ SUPPORT πŸŽ€

You can find documentation for this module with the perldoc command.

    perldoc Net::HTTPS::Any

You can also look for information at:

  • RT: CPAN's request tracker

<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-HTTPS-Any>

  • AnnoCPAN: Annotated CPAN documentation

<http://annocpan.org/dist/Net-HTTPS-Any>

  • CPAN Ratings

<http://cpanratings.perl.org/d/Net-HTTPS-Any>

  • Search CPAN

<http://search.cpan.org/dist/Net-HTTPS-Any>

go look at all of them, bestie, that's your enrichment time 🌈


Copyright 2008-2016 Freeside Internet Services, Inc. (<http://freeside.biz/>) All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. πŸ’–


okay that's the whole page, and for the cute sign-off: this was rendered by perl v5.36.0, dated 2022-11-19, and the page itself is Net::HTTPS::Any(3pm) πŸ¦‹πŸ’… mwah, go ship something, iykyk πŸ’œ

πŸ“¦ where this page comes from