0.11
[Net-HTTPS-Any.git] / t / post-cryptssleay.t
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5 use Test::More;
6
7 BEGIN {
8
9   plan skip_all => "LWP tests disabled to avoid excessive dependencies";
10
11   plan( tests=>4 );
12   $Net::HTTPS::Any::skip_NetSSLeay=1;
13   $Net::HTTPS::Any::skip_NetSSLeay=1;
14   use_ok 'Net::HTTPS::Any', 'https_post';
15 };
16
17 #200
18
19 my($content, $response, %headers) = https_post(
20   { 'host' => 'www.google.com',
21     'port' => 443,
22     'path' => '/accounts/ServiceLoginAuth',
23     'args' => { 'posted' => 'data' },
24   },
25   'net_https_any_test' => 1,
26 );
27
28 #like($response, qr/^HTTP\/[\d\.]+\s+200/i, 'Received 200 (OK) response');
29 like($response, qr/^200/i, 'Received 200 (OK) response');
30
31 ok( length($content), 'Received content' );
32
33 #404
34
35 my($content2, $response2, %headers2) = https_post(
36   { 'host' => 'www.google.com',
37     'port' => 443,
38     'path' => '/notfound.html',
39     'args' => { 'length' => 'required' },
40   },
41   'net_https_any_test' => 1,
42 );
43
44 #like($response2, qr/^HTTP\/[\d\.]+\s+404/i, 'Received 404 (Not FOund) response');
45 like($response2, qr/^404/i, 'Received 404 (Not Found) response');
46