httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Issac Goldstand <mar...@beamartyr.net>
Subject Re: The best practice to definitevely read post data
Date Tue, 27 Mar 2007 07:17:06 GMT
If your post data is multipart/form-data or
application/x-www-form-urlencoded, consider using libapreq
(http://httpd.apache.org/apreq/) which will do the heavy lifting for you
quite nicely...

  Issac

Thib wrote:
> Hi,
> 
> I'm writing a new apache module to handle post data and to generate a
> response. I'm using a handler, read post data with the methods
> ap_setup_client_block, ap_should_client_block and ap_get_client_block
> and It
> works correctly
> 
> However, I ask myself about the best way to read post data ( with brigade
> and buckets for example ? )
> 
> Thanks for your help.
> 
> Thibaud
> 
> PS : Here an example of how I read post data.
> 
>    ap_setup_client_block(r, REQUEST_CHUNKED_DECHUNK);
> 
>    char buffer[1024];
> 
>    if ( ap_should_client_block(r) == 1 ) {
>        while ( ap_get_client_block(r, buffer, 1024) > 0 ) {
>             ap_rputs("Reading in buffer...<br>",r);
>             ap_rputs(buffer,r);
>        }
>    }
>    else {
>        ap_rputs("Nothing to read...<br>",r);
>    }
> 

Mime
View raw message