From Code to Community: Sponsoring The Perl and Raku Conference 2025 Learn more

use strict;
use Test::More tests => 3;
use FindBin;
use lib "$FindBin::Bin";
require TestServer;
my $s = TestServer->new();
my $url_root = $s->started_ok("starting a test server");
my $q = HTTP::Async->new;
my $req = HTTP::Request->new( 'GET', "$url_root?delay=0" );
$req->header( 'Cookie', 'foo=bar' );
ok $q->add($req), "Added request to the queue";
$q->poke while !$q->to_return_count;
my $res = $q->next_response;
is $res->code, 200, "Got a response";