httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thib <chep...@gmail.com>
Subject Re: The best practice to definitevely read post data
Date Tue, 27 Mar 2007 12:36:41 GMT
Ok, thanks for your help.

As you advise me, I'm not going to use apreq... I'm will read post data with
ap_get_client_block routine.

Best regards,

Thibaud

2007/3/27, Issac Goldstand <margol@beamartyr.net>:
>
> You could, but you'd need to write your own parser, which I'm not sure
> you'd want to do...
>
> Thib wrote:
> > Hi,
> >
> > Thanks for your response. The post data I must read is pure xml.
> > If I understand well the doc of apreq, it handle data parsing
> > application/x-www-form-urlencoded and multipart/form-data. So with
> apreq,
> > can I read the post data ?
> >
> > Best regards,
> >
> > Thibaud
> >
> > 2007/3/27, Issac Goldstand <margol@beamartyr.net>:
> >>
> >> 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message