This is what I currently use for a few mason implementations:

It depends on your environment as to what you can do.
Apache/mod_perl has an easier way of doing it than CGI/FCGi, which uses
FakeApache.
As you can see from the comment, since FakeApache implements read, I
couldn't get it to be completely dynamic:

my $inputText;
# FakeApache implements read, so we can't automatically tell if we're in
mod_perl or FCGI
if (0 && $r->can('read')){
        $r->read( $inputText, $r->headers_in->{'Content-length'} );
        }
else {
        my %params = $r->params;
        my $posted_content = $params{POSTDATA} || $params{keywords};
        $posted_content ||= join '', %params if ($r->method eq 'POST');
        $posted_content = join '', @$posted_content if (ref $posted_content
eq 'ARRAY');
        $inputText = $posted_content
        }

Regards

Gareth

>-----Original Message-----
>From: [EMAIL PROTECTED] 
>[mailto:[EMAIL PROTECTED] On Behalf 
>Of Emmanuel Lacour
>Sent: 23 May 2007 09:41
>To: mason-users@lists.sourceforge.net
>Subject: [Mason] Getting the raw POST content
>
>
>Hi,
>
>I try to get the raw content of a POST in a mason component, but I
>cannot find a way to do this in the documentation. Is this possible?
>
>(the content is an XML)
>
>Thanks for any help :)
>
>-- 
>Emmanuel Lacour
>
>---------------------------------------------------------------
>----------
>This SF.net email is sponsored by DB2 Express
>Download DB2 Express C - the FREE version of DB2 express and take
>control of your XML. No limits. Just data. Click to get it now.
>http://sourceforge.net/powerbar/db2/
>_______________________________________________
>Mason-users mailing list
>Mason-users@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/mason-users


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to