Welcome! Log In Create A New Profile

Advanced

Re: Read request_body of a POST request

Maxim Dounin
January 14, 2011 07:06AM
Hello!

On Fri, Jan 14, 2011 at 05:52:57AM -0500, michalkraus wrote:

> Hello,
> I'm working on a modul, that should get a POST request with XML-RPC data
> and then send a response.
> I have problem with getting the request_body. It's no problem to read
> headers and find Content-Type: text/xml. But when I want to read the
> request_body there is no one. I use the same code as the function for
> reading request_body in ngx_http_variable.
> My modul is a handler (something like circe_gif module). When my module
> is filter and the request is passed to the proxy module I can read the
> request body in my filter module.
> Is it possible to read headers and the request_body and then generate a
> response by handlers?

Yes. You have to use ngx_http_read_client_request_body() function
and generate response in post_handler callback (the one you've
passed to function).

See e.g. proxy or dav modules for examples.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Read request_body of a POST request

michalkraus January 14, 2011 05:52AM

Re: Read request_body of a POST request

Maxim Dounin January 14, 2011 07:06AM

Re: Read request_body of a POST request

michalkraus January 14, 2011 08:32AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 248
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