[Catalyst] Testing RESTful web services
Ian Docherty
catalyst at iandocherty.com
Mon Oct 6 05:35:10 BST 2008
Moritz Onken wrote:
>
> Am 05.10.2008 um 10:47 schrieb Ian Docherty:
>
>> Hi
>> 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.
>>
>> Any ideas?
>>
>> ------ test.t -------
>> use strict;
>> use warnings;
>>
>> use Catalyst::Test 'MyApp';
>> use HTTP::Request;
>>
>> my $req =3D HTTP::Request->new(
>> 'POST',
>> '/foo',
>> [
>> Content_Type =3D> 'text/plain'
>> ],
>> "hello world",
>> );
>
> It's Content-type =3D> ...
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.
Just a slight modification to my original statement. In the controller =
the request body is undef, but the request length is 0 (not undef)
Regards
Ian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20081006/cd687=
192/attachment.htm
More information about the Catalyst
mailing list