|| at Oct 6, 2008 at 8:58 am
Ian Docherty wrote:
Moritz Onken wrote:
Am 05.10.2008 um 10:47 schrieb Ian Docherty:
I am writing a simple test to test a POST method in a web service
but my controller does not see any content in the POSTed request.
In the controller both the $c->request->body and
$c->request->content_length are undefined.
------ test.t -------
use Catalyst::Test 'MyApp';
my $req = HTTP::Request->new(
Content_Type => 'text/plain'
It's Content-type => ...
Yup, typo on my part, but it does not change the problem. There is
still no content in the request when it gets to the controller.
It's not a typo, the constructor accepts underscores as well as dashes
so that you can build requests without having to quote the hash keys.
Just a slight modification to my original statement. In the controller
the request body is undef, but the request length is 0 (not undef)
IIRC you have to manually add content-length yourself, HTTP::Request
doesn't build it for you.