- Updated servers used for testing in examples and tests
[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   plan( tests=>4 );
9   $Net::HTTPS::Any::skip_NetSSLeay=1;
10   $Net::HTTPS::Any::skip_NetSSLeay=1;
11   use_ok 'Net::HTTPS::Any', 'https_post';
12 };
13
14 #200
15
16 my($content, $response, %headers) = https_post(
17   { 'host' => 'www.google.com',
18     'port' => 443,
19     'path' => '/accounts/ServiceLoginAuth',
20     'args' => { 'posted' => 'data' },
21   },
22   'net_https_any_test' => 1,
23 );
24
25 #like($response, qr/^HTTP\/[\d\.]+\s+200/i, 'Received 200 (OK) response');
26 like($response, qr/^200/i, 'Received 200 (OK) response');
27
28 ok( length($content), 'Received content' );
29
30 #404
31
32 my($content2, $response2, %headers2) = https_post(
33   { 'host' => 'www.fortify.net',
34     'port' => 443,
35     'path' => '/notfound.html',
36   },
37   'net_https_any_test' => 1,
38 );
39
40 #like($response2, qr/^HTTP\/[\d\.]+\s+404/i, 'Received 404 (Not FOund) response');
41 like($response2, qr/^404/i, 'Received 404 (Not Found) response');
42