Welcome! Log In Create A New Profile

Advanced

Re: Trouble getting the Request Body of a HTTP Post

December 18, 2009 08:32AM
Nick Pearson Wrote:
-------------------------------------------------------
> curl is a good way to test URLs without having to
> re-type everything
> each time. You can POST by using the -d or -f
> option. Much better
> than telnet for this type of testing, in my
> experience.

Yes, I've heard of cURL but hadn't used it a whole lot. I've installed it and will give it a try, thanks!

Maxim Dounin Wrote:
-------------------------------------------------------
> You should use ->bufs. Here is the comment from
> ngx_http_request_body.c which should be helpful:
>
> /*
> * on completion
> ngx_http_read_client_request_body() adds to
> * r->request_body->bufs one or two bufs:
> * *) one memory buf that was preread in
> r->header_in;
> * *) one memory or file buf that contains the
> rest of the body
> */
>
> Simple example of using request_body may be found
> in
> ngx_http_variables.c, in function
> ngx_http_variable_request_body().
>

Ah, I was looking for something like that. Thanks!

>
> > So if I specify "client_body_in_single_buffer"
> as "true", does
> > it store the entire client request in
> r->request_body->buf?
>
> No. It will be in first buffer of
> r->request_body->bufs, either
> in memory if it fits into client_body_buffer_size
> or in file.
>
> > But if not, does it separate the client request
> body into the
> > chunks of whatever client_body_buffer_size is
> set to, and then
> > you use the chain to gain access to the entire
> thing?
>
> Not exactly. Currently r->request_body->bufs will
> contain up to two
> buffers: one for data preread with headers, and
> one for data got
> later. If there are more data than
> client_body_buffer_size - the
> last buffer will be in temporary file.
>
> It's probably a good idea to spend some time
> reading
> ngx_http_request_body.c for better clue what
> happens in various
> cases.

> Maxim Dounin

Gotcha. I think I'm getting a handle on what's going on. Thanks again for all your help!
Subject Author Posted

Trouble getting the Request Body of a HTTP Post

Tronman December 17, 2009 11:35AM

Re: Trouble getting the Request Body of a HTTP Post

Maxim Dounin December 17, 2009 12:44PM

Re: Trouble getting the Request Body of a HTTP Post

Tronman December 17, 2009 01:58PM

Re: Trouble getting the Request Body of a HTTP Post

Tronman December 17, 2009 02:28PM

Re: Trouble getting the Request Body of a HTTP Post

Maxim Dounin December 17, 2009 02:32PM

Re: Trouble getting the Request Body of a HTTP Post

Tronman December 17, 2009 03:33PM

Re: Trouble getting the Request Body of a HTTP Post

barretto_chris February 08, 2011 06:38PM

Re: Trouble getting the Request Body of a HTTP Post

Nick Pearson December 17, 2009 03:50PM

Re: Trouble getting the Request Body of a HTTP Post

Maxim Dounin December 17, 2009 05:02PM

Re: Trouble getting the Request Body of a HTTP Post

Tronman December 18, 2009 08:32AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 84
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready