[Catalyst] POST problem [resent]

Matt S Trout dbix-class at trout.me.uk
Sun Mar 19 23:33:49 CET 2006


Richard Jolly wrote:
> [resent to correct address]
> 
> Hi,
> 
> We recently upgraded from 5.33 to 5.66. There has been very little
> breakage, but we do have something that I can't figure out.
> 
> # from test script
> 
> my $post = HTTP::Request->new(
>    POST => 'http://localhost/import/'
> );
> $post->header( name => $name );
> $post->content( $some_xml );
> 
> request( $post )
> 
> # from controller
> 
> my $name = $c->req->header('name'); # ok
> my $content = $c->req->body; # empty
> 
> 
> I'm not sure how this code should be upgraded. As far as I can see
> ->body is not expected to work with POST, but I can't see what the
> alternative is supposed to be.

I suspect you need to specify the content-type on the request so it doesn't 
get submitted as x-form/url-encoded (or whatever the usual form type is)

-- 
      Matt S Trout       Offering custom development, consultancy and support
   Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Catalyst mailing list