| From | Sent On | Attachments |
|---|---|---|
| John Moore | Mar 8, 2011 4:07 am | |
| agentzh | Mar 8, 2011 4:19 am | |
| António P. P. Almeida | Mar 8, 2011 10:59 am | |
| John Moore | Mar 9, 2011 10:42 am | |
| Richard Kearsley | Mar 9, 2011 11:15 am | |
| John Moore | Mar 9, 2011 12:39 pm | |
| agentzh | Mar 9, 2011 7:38 pm | |
| agentzh | Mar 9, 2011 7:52 pm | |
| Elena Zwetkow | Mar 10, 2011 12:16 am | |
| agentzh | Mar 10, 2011 12:28 am | |
| Elena Zwetkow | Mar 10, 2011 1:01 am | |
| agentzh | Mar 10, 2011 1:33 am | |
| Alexander Kunz | Mar 15, 2011 3:14 pm | |
| agentzh | Mar 15, 2011 7:28 pm | |
| Alexander Kunz | Mar 16, 2011 12:22 am | |
| agentzh | Mar 16, 2011 12:36 am |
| Subject: | Re: [ANN] ngx_echo v0.35: ability to POST/PUT local files as subrequest bodies | |
|---|---|---|
| From: | agentzh (agen...@gmail.com) | |
| Date: | Mar 15, 2011 7:28:02 pm | |
| List: | ru.sysoev.nginx | |
On Wed, Mar 16, 2011 at 6:15 AM, Alexander Kunz <aku...@ntmedia.de> wrote:
Hello,
any chance to debug the -f function? I use the debug log, but get no information about the file... /body1 shows me "test" but /body2 shows nothing... no error, no body content...
Because there's no error in your /body2 request, no log is expected to be printed ;)
location /body1 { echo_subrequest POST /sub -b 'test'; }
location /body2 { echo_subrequest POST /sub -f /tmp/hello.txt; }
location /sub { echo "body: $echo_request_body"; }
Why $echo_request_body is empty for /body2? Because "echo_subrequest /sub -f /tmp/hello.txt" produces a request body that consists of *file* buffers only (such that nginx does not bother reading the whole disk file into RAM at once) and $echo_request_body only respects pure *memory* buffers.
The following example comes from the ngx_echo's test suite:
location /main { echo_subrequest POST /sub -f html/blah.txt; }
location /sub { echo "sub method: $echo_request_method"; # we don't need to call echo_read_client_body explicitly here echo_request_body; }
where html/blah.txt contains the following contents:
Hello, world
Then GET /main gives
sub method: POST Hello, world
Cheers, -agentzh
_______________________________________________ nginx mailing list ngi...@nginx.org http://nginx.org/mailman/listinfo/nginx





