<!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">
Jonathan Rockway wrote:
<blockquote cite="mid:871w84si5k.fsf@bar.jrock.us" type="cite">
  <pre wrap="">* Ian Docherty <a class="moz-txt-link-rfc2396E" href="mailto:catalyst@iandocherty.com">&lt;catalyst@iandocherty.com&gt;</a> writes:

  </pre>
  <blockquote type="cite">
    <pre wrap="">I am sending a POST to a Catalyst app and according to the documention
I expected the request body to
contain the data I sent. Instead it holds a filename in the tmp
directory which contains the document. Is
this an expected behaviour?

e.g. in my test script

my $request = HTTP::Request-&gt;new(POST =&gt; '<a class="moz-txt-link-freetext" href="http://linux:3000/svc/to/1001">http://linux:3000/svc/to/1001</a>');
$request-&gt;content_type('text/text');
$request-&gt;content('THIS IS THE STRING');
my $response = $ua-&gt;request($request);
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Basically, HTTP::Body assumes you are sending your content as
application/octet-stream, since it's not multipart/form-data or
application/x-www-form-urlencoded (the two cases that it treats
specially).

Since file uploads are application/octet-stream, we put the data into
a file.  Maybe it would be better to keep it in memory unless
Content-Length exceeds a certain length, but the current behavior is
consistent and reliable, so I don't see why we should change it.  It's
really not that confusing.

Finally, the "string" that you see in $c-&gt;req-&gt;body is actually an
IO::File object, so you can easily suck the file in if the need
arises.

Regards,
Jonathan Rockway

____________</pre>
</blockquote>
Thank you for that explanation. In the light of this does the following
seem reasonable.<br>
<br>
I am creating a web service (xml over http) so the POST method would
present an xml<br>
document to the controller using content-type text/xml and the
controller would read it<br>
and parse it.<br>
<br>
Regards<br>
Ian<br>
<br>
</body>
</html>