<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<div class="moz-text-flowed"
style="font-family: -moz-fixed; font-size: 13px;" lang="x-western">Moritz
Onken wrote:
<br>
<blockquote type="cite"><br>
Am 05.10.2008 um 10:47 schrieb Ian Docherty:
<br>
<br>
<blockquote type="cite">Hi
<br>
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.
<br>
<br>
In the controller both the $c->request->body and
$c->request->content_length are undefined.
<br>
<br>
Any ideas?
<br>
<br>
------ test.t -------
<br>
use strict;
<br>
use warnings;
<br>
<br>
use Catalyst::Test 'MyApp';
<br>
use HTTP::Request;
<br>
<br>
my $req = HTTP::Request->new(
<br>
'POST',
<br>
'/foo',
<br>
[
<br>
Content_Type => 'text/plain'
<br>
],
<br>
"hello world",
<br>
);
<br>
</blockquote>
<br>
It's Content-type => ...
<br>
</blockquote>
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.
<br>
<br>
Just a slight modification to my original statement. In the controller
the request body is undef, but the request length is 0 (not undef)
<br>
<br>
Regards
<br>
Ian
<br>
<br>
<br>
</div>
</body>
</html>