in reply to Re: Does CGI::Application expose a HTTP::Request object?
in thread Does CGI::Application expose a HTTP::Request object?

After some testing I've found out that basically this works except for reading the $content in on PUT. As it seems there's nothing on STDIN, although the content-length header is correct. And reading the PUTDATA param fails, nothing there.

On textual data I get structures like this in the C::A object:
'__QUERY_OBJ' => bless( { '.script_name' => '/test.tx +t', '.parameters' => [ 'keyword +s' ], 'use_tempfile' => 1, '.path_info' => '', '.charset' => 'utf-8', '.fieldnames' => {}, 'param' => { 'keywords' => +[ + '12345', + '12345', + 'abcde', + 'abcde', + 'äöüäö', + 'äöüäö' +] },
whereas binary data produces
'__QUERY_OBJ' => bless( { '.script_name' => '/image.j +pg', '.parameters' => [ 'lots', 'of', 'array', 'entries', 'of', 'binary', 'data', 'split', ], 'use_tempfile' => 1, '.path_info' => '', '.charset' => 'utf-8', '.fieldnames' => {}, 'param' => { 'and here a pa +rt of the binary data from the key' => [ + 'with more', + 'binary', + 'data', + 'filling', + 'the', + 'array' +] },

Replies are listed 'Best First'.
Re^3: Does CGI::Application expose a HTTP::Request object?
by isync (Hermit) on Aug 12, 2010 at 11:36 UTC
    After more testing and reading this node the problem seems to be CGI.pm.
    Since finding out, I upgraded my CGI.pm from 3.39 to 3.49, but either CGI.pm's PUTDATA param has gone missing again or soemthing is wrong on my side. Still, binary files end up as garbled mess in the .parmaters and param parts of __QUERY_OBJ -- Can anyone explain this??

    I've given up since, and replaced CGI.pm with CGI::Simple according to the above mentioned node, and - guess what - CGI::Simple properly parses out the $q->param('PUTDATA') parameter from the request and PUT finally works for me!