diff options
Diffstat (limited to 'lib/Web/Response.pm')
-rw-r--r-- | lib/Web/Response.pm | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/lib/Web/Response.pm b/lib/Web/Response.pm new file mode 100644 index 0000000..e7b96c9 --- /dev/null +++ b/lib/Web/Response.pm @@ -0,0 +1,51 @@ +package Web::Response; +use Moose; + +use HTTP::Headers; + +has status => ( + is => 'rw', + isa => 'Int', # XXX restrict to /^[1-5][0-9][0-9]$/ + lazy => 1, + default => sub { confess "Status was not supplied" }, +); + +has headers => ( + is => 'rw', + isa => 'HTTP::Headers', # XXX coerce from array/hashref + lazy => 1, + default => sub { HTTP::Headers->new }, + handles => { + header => 'header', + content_length => 'content_length', + content_type => 'content_type', + content_encoding => 'content_encoding', + location => [ header => 'Location' ], + }, +); + +has body => ( + is => 'rw', + lazy => 1, + default => sub { [] }, +); + +has cookies => ( + is => 'ro', + isa => 'HashRef', + lazy => 1, + default => sub { +{} }, +); + +sub redirect { + ... +} + +sub finalize { + ... +} + +__PACKAGE__->meta->make_immutable; +no Moose; + +1; |