Empty request body using Embedded Perl

Hi all,

We use $r->request_body method from Embedded Perl to process request
body. The problem is although $r->has_request_body() returns 1, the
request body is still evaluated to empty string.

PS: According to the Nginx wiki, when the client body exceeds the
value of client_max_body_size, it will be buffered to file. So we’ve
already raised client_max_body_size to 30M, but the request body
remains an empty string.

On Wed, Jan 12, 2011 at 11:26 AM, 杨镭 [email protected] wrote:

Hi all,

We use $r->request_body method from Embedded Perl to process request
body. The problem is although $r->has_request_body() returns 1, the
request body is still evaluated to empty string.

The has_request_body function only return memory-buffered request body
:slight_smile:

PS: According to the Nginx wiki, when the client body exceeds the
value of client_max_body_size, it will be buffered to file. So we’ve
already raised client_max_body_size to 30M, but the request body
remains an empty string.

No, exceeding client_max_body_size gives you 413 (Request Entity Too
Large).
You need to raise the value of client_body_buffer_size.

Cheers,
-agentzh

Hi:

Thanks for the clarification.

I am sure that the request body did not exceed client_body_buffer_size
since those requests body are very small , e.g,. curl -X POST -d
“name=rachel” http://example.sdo.com.

If $r->has_request_body() returns 1, the request body is indeed in
memory-buffered which means I don’t need to call
$r->request_body_file.

Please point out what I did wrong, thanks.