I have a piece of client software which sends an HTTP POST request asynchronously using a "chunked" transfer encoding ($ENV{HTTP_TRANSFER_ENCODING} is "chunked"), which I'm utterly unfamiliar with -- and unfortunately I can't change the client specification.
I need to write a simple server script to receive the client's chunked data, but I can't figure out how to deal with it. CGI->param isn't giving me anything; nor is <STDIN>. All I can guess is that I need to wait for data chunks to arrive? But I have no idea how to work this in Perl CGI, what to wait on, if there's a built-in routine at all, etc.
FWIW, the client is definitely sending the right data - I peeked at it with a packet sniffer - but I'm not 100% sure that the HTTP request/headers are encoded correctly.
Any sample code for receiving chunked POST data in Perl would be extremely helpful. I'm really hoping there's a way to do it in the CGI module without mucking around at the HTTP layer.