Fixed a bug where c->read didn't work properly, and added some tests for parse_on_dem...
[catagits/Catalyst-Runtime.git] / t / lib / TestAppOnDemand / Controller / Body.pm
CommitLineData
878b821c 1package TestAppOnDemand::Controller::Body;
2
3use strict;
4use base 'Catalyst::Base';
5
6use Data::Dump ();
7
8sub params : Local {
9 my ( $self, $c ) = @_;
10
11 $c->res->body( Data::Dump::dump( $c->req->body_parameters ) );
12}
13
14sub read : Local {
15 my ( $self, $c ) = @_;
16
17 # read some data
18 my @chunks;
19
20 while ( my $data = $c->read( 10_000 ) ) {
21 push @chunks, $data;
22 }
23
24 $c->res->content_type( 'text/plain');
25
26 $c->res->body( join ( '|', map { length $_ } @chunks ) );
27}
28
291;