blob: 44c3868a4a3d319c2f4359a99fe7808667117240 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# Test extra HTTP::Request methods. Basic operation is tested in the
# message.t test suite.
use strict;
use warnings;
use Test::More;
plan tests => 11;
use HTTP::Request;
my $req = HTTP::Request->new(GET => "http://www.example.com");
$req->accept_decodable;
is($req->method, "GET");
is($req->uri, "http://www.example.com");
like($req->header("Accept-Encoding"), qr/\bgzip\b/); # assuming IO::Uncompress::Gunzip is there
$req->dump(prefix => "# ");
is($req->method("DELETE"), "GET");
is($req->method, "DELETE");
is($req->uri("http:"), "http://www.example.com");
is($req->uri, "http:");
$req->protocol("HTTP/1.1");
my $r2 = HTTP::Request->parse($req->as_string);
is($r2->method, "DELETE");
is($r2->uri, "http:");
is($r2->protocol, "HTTP/1.1");
is($r2->header("Accept-Encoding"), $req->header("Accept-Encoding"));
|