6 Moose::Cookbook::Recipe5
16 use Params::Coerce ();
21 => where { $_->isa('HTTP::Headers') };
25 => via { HTTP::Headers->new( @{ $_ } ) }
27 => via { HTTP::Headers->new( %{ $_ } ) };
31 => where { $_->isa('URI') };
35 => via { $_->isa('URI') ? $_ : Params::Coerce::coerce( 'URI', $_ ) }
37 => via { URI->new( $_, 'http' ) };
41 => where { /^HTTP\/[0-9]\.[0-9]$/ };
43 has 'base' => (is => 'rw', isa => 'Uri', coerce => 1);
44 has 'url' => (is => 'rw', isa => 'Uri', coerce => 1);
45 has 'method' => (is => 'rw', isa => 'Str');
46 has 'protocol' => (is => 'rw', isa => 'Protocol');
51 default => sub { HTTP::Headers->new }
58 Stevan Little E<lt>stevan@iinteractive.comE<gt>
60 =head1 COPYRIGHT AND LICENSE
62 Copyright 2006 by Infinity Interactive, Inc.
64 L<http://www.iinteractive.com>
66 This library is free software; you can redistribute it and/or modify
67 it under the same terms as Perl itself.