Trouble getting the Request Body of a HTTP Post

Nick Pearson nick.pearson at gmail.com
Thu Dec 17 23:45:26 MSK 2009


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.


On Thu, Dec 17, 2009 at 2:33 PM, Tronman <nginx-forum at nginx.us> wrote:
>> Most likely you did something wrong, either while
>> telneting or in you module.
>
> Precisely, it was a mistake I was making with my telnet session. I misinterpreted "sending" as really just inserting a couple of new lines. Also, it worked properly when I wrote a simple form to POST in Firefox.
>
> Great! Your response cleared up nearly everything for me, the only other thing I'm not completely clear on is the difference between:
>
> ngx_chain_t                      *bufs;
>
> and
>
> ngx_buf_t                        *buf;
>
> in ngx_http_request_body_t. What is the difference between them? When should I use either to access the body?
>
> I seem to be able to access:
>
> r->request_body->buf->start  and
> r->request_body->buf->pos
>
> the same as I can use:
>
> r->request_body->bufs->buf->start  and
> r->request_body->bufs->buf->pos
>
> While r->request_body->bufs->next is NULL.  So obviously the chain is some sort of linked list.
>
> My only clue here are the:
>
> client_body_in_single_buffer   and
> client_body_buffer_size
>
> directives in NginxHttpCoreModule
>
> So if I specify "client_body_in_single_buffer" as "true", does it store the entire client request in r->request_body->buf?
> 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?
>
> Thanks again!
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,31312,31404#msg-31404
>
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx
>



More information about the nginx mailing list