X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FTestAppOnDemand%2FController%2FBody.pm;h=4ee9e0f78872f64732c4396b1d53c92060757954;hb=HEAD;hp=aca4a5eb8ebaa0d5993edaa468730f65e1e42957;hpb=878b821cd4548d9d3f5a6c5aa05fb2f0c29fe3b0;p=catagits%2FCatalyst-Runtime.git diff --git a/t/lib/TestAppOnDemand/Controller/Body.pm b/t/lib/TestAppOnDemand/Controller/Body.pm index aca4a5e..4ee9e0f 100644 --- a/t/lib/TestAppOnDemand/Controller/Body.pm +++ b/t/lib/TestAppOnDemand/Controller/Body.pm @@ -1,29 +1,41 @@ package TestAppOnDemand::Controller::Body; use strict; -use base 'Catalyst::Base'; +use base 'Catalyst::Controller'; use Data::Dump (); -sub params : Local { +sub body_params : Local { my ( $self, $c ) = @_; $c->res->body( Data::Dump::dump( $c->req->body_parameters ) ); } +sub query_params : Local { + my ( $self, $c ) = @_; + + $c->res->body( Data::Dump::dump( $c->req->query_parameters ) ); +} + +sub params : Local { + my ( $self, $c ) = @_; + + $c->res->body( Data::Dump::dump( $c->req->parameters ) ); +} + sub read : Local { my ( $self, $c ) = @_; - + # read some data my @chunks; - + while ( my $data = $c->read( 10_000 ) ) { push @chunks, $data; } $c->res->content_type( 'text/plain'); - + $c->res->body( join ( '|', map { length $_ } @chunks ) ); } -1; \ No newline at end of file +1;