[dev] how to read client body data

Igor Sysoev is at rambler-co.ru
Wed Aug 22 09:02:22 MSD 2007


On Tue, Aug 21, 2007 at 11:14:00PM +0200, Manlio Perillo wrote:

> Manlio Perillo ha scritto:
> >Hi.
> >
> >I'm tryng to understand how to read client body data for a request.
> >
> > [...]
> >
> >To read the client body data, all I have to do is to set the previous 
> >parameters (as I wish) and call ngx_http_read_client_request_body with a 
> >"secondary" handler that will receive the request object filled with the 
> >necessary data?
> >
> 
> One last thing.
> 
> If I set the parameters
>   request_body_in_file_only = 1
>   request_body_in_persistent_file = 0
> 
> then the entire request body will be saved in a temporary file and this 
> file will be removed when I finalize the request?
> 
> The request->request_body->temp_file->file->fd handle is opened for read 
> (and will be closed at request finalization)?

Yes. Do not forget to test

    if (r->request_body && r->request_body->temp_file) {


-- 
Игорь Сысоев
http://sysoev.ru





More information about the nginx mailing list