You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Phil Endecott <sp...@chezphil.org> on 2006/02/02 23:45:38 UTC

Accessing POST request body from a module

Dear All,

I am porting some CGI code to run as a module.  It is all pretty 
straightforward, except that I can't work out how to get at a POST 
request's body.  The CGI code reads from stdin, which doesn't seem to be 
the right thing to do in the module.  I'm probably missing something 
obvious; maybe I'm not searching for the right keywords.  Can someone 
point me in the right direction?

Many Thanks,

--Phil.


Re: Accessing POST request body from a module

Posted by Nick Kew <ni...@webthing.com>.
On Thursday 02 February 2006 22:45, Phil Endecott wrote:
> [chop]

If you had a usable-looking email address. I could reply with
exactly what you need, from something that's not currently
available on a public mailinglist.

-- 
Nick Kew

Re: Accessing POST request body from a module

Posted by Michael VERGOZ <mv...@binarysec.com>.
Hello,

With something like that :
while (ap_get_brigade(r->input_filters, brigade, AP_MODE_READBYTES, 
APR_BLOCK_READ, len) == APR_SUCCESS) {
    apr_brigade_flatten(brigade, buf, &len);
    apr_brigade_cleanup(brigade);
    tlen += len;
    if (tlen == count_bytes || !len) {
        break;
    }
    buf += len;
    len = count_bytes - tlen;
}


----- Original Message ----- 
From: "Phil Endecott" <sp...@chezphil.org>
To: <de...@httpd.apache.org>
Sent: Thursday, February 02, 2006 11:45 PM
Subject: Accessing POST request body from a module


> Dear All,
>
> I am porting some CGI code to run as a module.  It is all pretty 
> straightforward, except that I can't work out how to get at a POST 
> request's body.  The CGI code reads from stdin, which doesn't seem to be 
> the right thing to do in the module.  I'm probably missing something 
> obvious; maybe I'm not searching for the right keywords.  Can someone 
> point me in the right direction?
>
> Many Thanks,
>
> --Phil.
>
>