ls::JSON::Pointer;
# test an external website
http_request(
# you can also test against a real HTTP server
GET('http://example.test'),
http_response {
http_is_success;
# JSON po
inter { "key":"val" }
http_content json '/key' => 'val';
}
);
done_testing;
with short names:
use Test2::Tools::HTTP ':short';
use HTTP::Request::Common;
app_add { [ 200, [ 'Content
e conversion of the response body:
use JSON::PP qw( decode_json );
Test2::Tools::HTTP::Tx->add_helper( 'res.json' => sub {
my $res = shift;
decode_json( $res->decoded_content );
});
You can