Welcome! Log In Create A New Profile

Advanced

How do i get the request body ?

January 01, 2014 11:44PM
Hello guys,

I'm developing a nginx module, the intent is to get the request body, then write some response depends on what request body is.
I've called the method ngx_http_read_client_request_body (r, ngx_http_myModule_handler);

Since this code, i want to get the real request body in ngx_http_myModule_handler()
Here are my codes ...

void ngx_http_myModule_handler(ngx_http_request_t *r)
{
ngx_http_finalize_request(r, NGX_DONE);

if(!(r->request_body->bufs == NULL)){
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "request is not empty.");

}
}

the questions is , how can i get the r->request_body->bufs to char * ?
SubjectAuthorPosted

How do i get the request body ?

humankJanuary 01, 2014 11:44PM

Re: How do i get the request body ?

Maxim DouninJanuary 02, 2014 10:42PM

Re: How do i get the request body ?

humankJanuary 09, 2014 12:52AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 98
Record Number of Users: 2 on November 23, 2014
Record Number of Guests: 377 on November 23, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready