[Twisted-web] Set request headers in rend.Page

Mary Gardiner mary-twisted at puzzling.org
Mon May 31 19:03:06 MDT 2004


On Tue, Jun 01, 2004, Mary Gardiner wrote:
> Is there some point where I can add new headers to the request in a
> Page itself? I haven't tested thoroughly, but it seems to me that the
> HTTP headers have already been transmitted by the time render_ and
> data_ methods are called.

Looking at the implementation of rend.Page.renderHTTP makes me suspect
that the way to do this is by making a beforeRender(self, request)
method. Is this right?

And if so, beforeRender looks like it's meant to be synchronous, and
unfortunately my "check for new data" method needs to wait on a Deferred
to be called back.

-Mary



More information about the Twisted-web mailing list