Changeset 17400

Show
Ignore:
Timestamp:
08/11/08 16:15:34 (5 years ago)
Author:
yappo
Message:

rewrite examples

Location:
lang/perl/HTTP-Engine/trunk/examples
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/HTTP-Engine/trunk/examples/lighty/test_fastcgi.pl

    r11771 r17400  
    2222        }, 
    2323        request_handler => sub { 
    24             my $c = shift; 
     24            my $req = shift; 
    2525 
    26             $c->res->content_type('text/html'); 
    27  
    28             $c->res->body( render_body( Dumper($c->req) ) ); 
     26            my $res = HTTP::Engine::Response->new; 
     27            $res->content_type('text/html'); 
     28            $res->body( render_body( Dumper($req) ) ); 
     29            $res; 
    2930         } 
    3031    }, 
  • lang/perl/HTTP-Engine/trunk/examples/poe-dumper.pl

    r11826 r17400  
    77use HTTP::Response; 
    88use HTTP::Engine::Request; 
    9 use HTTP::MobileAttribute; 
    109use String::TT qw/strip tt/; 
    1110 
     
    1413        port    => 3999, 
    1514        request_handler => sub { 
    16             my $c = shift; 
     15            my $req = shift; 
    1716            local $Data::Dumper::Sortkeys = 1; 
    18             my $req_dump = Dumper( $c->req ); 
    19             my $raw      = $c->req->raw_body; 
     17            my $req_dump = Dumper( $req ); 
     18            my $raw      = $req->raw_body; 
    2019            my $body     = strip tt q{  
    2120                <form method="post"> 
     
    3332            }; 
    3433 
    35             $c->res->body($body); 
     34            HTTP::Engine::Response->new( body => $body ); 
    3635        }, 
    3736    }), 
  • lang/perl/HTTP-Engine/trunk/examples/yamlconfig-dumper.pl

    r11805 r17400  
    1717 
    1818sub handler { 
    19     my $c = shift; 
     19    my $req = shift; 
    2020    local $Data::Dumper::Sortkeys = 1; 
    21     my $req_dump = Dumper( $c->req ); 
    22     my $raw      = $c->req->raw_body; 
     21    my $req_dump = Dumper( $req ); 
     22    my $raw      = $req->raw_body; 
    2323    my $body     = strip tt q{  
    2424        <form method="post"> 
     
    3636    }; 
    3737 
    38     $c->res->body($body); 
     38    HTTP::Engine::Response->new( body => $body ); 
    3939}