File: advent_2012_3.pl

package info (click to toggle)
libtest-lwp-useragent-perl 0.036-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 428 kB
  • sloc: perl: 530; makefile: 10
file content (16 lines) | stat: -rw-r--r-- 396 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use strict;
use warnings;
use feature 'say';

use Test::LWP::UserAgent;
use HTTP::Message::PSGI;
use HTTP::Request::Common;
use Plack::Util;

my $useragent = Test::LWP::UserAgent->new;
my $app = Plack::Util::load_psgi('examples/myapp.psgi');
$useragent->register_psgi('mytestdomain.com', $app);
my $response = $useragent->request(GET 'http://mytestdomain.com/foo/bar');

say $response->content;