perlrestmason

Mason: Request Payload


I need to receive data, which comes in 'Request Payload' header, with Mason-based Perl script.

I have tried $r->body(), $r->upload(), $m->content() methods, but they returns empty string.

The data in request exists, I have checked it with Chrome dev-tools.


Solution

  • Solution:

    my $raw_body;
    $r->read($raw_body, $r->headers_in->{'Content-length'});