Loading ...
Sorry, an error occurred while loading the content.

Re: poking into request content?

Expand Messages
  • Stas Bekman
    ... Not really. You could subclass $r, but your other handlers need to be aware of this. So it s not transparent. ... In which case you probably need to look
    Message 1 of 4 , Jan 2, 2004
    • 0 Attachment
      Jan Algermissen wrote:
      > Geoffrey Young wrote:
      >
      >>Jan Algermissen wrote:
      >>
      >>>Hi,
      >>>
      >>>I want to write a Perl handler that pokes into the content
      >>>of a request in order to see if a certain parameter is present and
      >>>if so to change the request method.
      >>>
      >>>Ok, I am finally aware that content() may onle be called once on
      >>>a request object so any further handlers won't be able to see the
      >>>original content.
      >>>
      >>>Is there a way to restore that data after calling content() or read()?
      >>
      >>see Apache::Request->instance()
      >
      >
      > Geoffrey--
      >
      > thanks. I tried that but am I right in suspecting that subsequent handlers
      > also need to work with Apache::Request? IOW: is there a way to use Apache::Request
      > and later use the notrmal $r->content() call?

      Not really. You could subclass $r, but your other handlers need to be aware of
      this. So it's not transparent.

      > I want to impose abslolutely no constraint on subsequent handlers (as they
      > might not even be related to my application).

      In which case you probably need to look at input filters available only with
      mod_perl 2. Though remember that the body filter will be invoked only if some
      handler is trying to consume the body.

      In fact Apache::Request 2, does exactly that - it injects itself as a filter,
      making the POSTed body available to any consumer that calls into libapreq's
      instance method (perl, c, php, whatever)

      __________________________________________________________________
      Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
      http://stason.org/ mod_perl Guide ---> http://perl.apache.org
      mailto:stas@... http://use.perl.org http://apacheweek.com
      http://modperlbook.org http://apache.org http://ticketmaster.com


      --
      Reporting bugs: http://perl.apache.org/bugs/
      Mail list info: http://perl.apache.org/maillist/modperl.html
    Your message has been successfully submitted and would be delivered to recipients shortly.