Can anyone try this code and post if anything comes out? I don't get any
output. I suspect something is wrong on the lib level.

I'm on Windows 10 with Strawberry Perl 5.24 64bit btw.

======

#!/usr/bin/perl

use strict;
use warnings;

use IO::Async::Loop::Glib;
use Net::Async::HTTP;
use Gtk2 qw( -init );

my $loop = IO::Async::Loop::Glib->new;

my $ua = Net::Async::HTTP->new;
$loop->add( $ua );

recognition();

Gtk2->main;



sub recognition
{
   my $f = $ua->POST(
      "http://www.google.com";,
      [
         test => "params",
         go => "here",
      ]
   )->then(
      # success
      sub {
         my ( $response ) = @_;

         print "response is: $response\n";
         Future->done;
      },

      # failure
      sub {
         my ( $error ) = @_;

         print "failure is $error\n";
         Future->done;
      },
   );

   $ua->adopt_future( $f );
}

Reply via email to