|
Jim Gallacher
jg.lists at sympatico.ca
Wed Oct 19 08:37:24 EDT 2005
Robert Squire wrote:
> Jason Stubbs wrote:
>
>> Robert Squire wrote:
>>
>>> Here is the file I'm using:
>>> -----------------------------------------------------
>>> didactic htdocs # cat mptest.py
>>> from mod_python import apache
>>>
>>> def hadler(req):
>>
>>
>> ^^^^^^
>>
>>> req.content_type = 'text/plain'
>>> req.sent_http_header()
>>> req.write("Hello World!")
>>> return apache.OK
>>>
>>> -----------------------------------------------------
>>
>>
>>
>> Don't you just hate typos? ;)
>>
>> --
>> Jason Stubbs
>>
> UGGHHH. Indeed I do hate typos.
> Thank you so much for this. I also typed sent_http_header instead of
> send_http_header.
You don't need send_http_header. In fact for mod_python version 3.0.0
and greater it is a noop. When req.write is called mod_python checks if
the headers have been sent, and if not sends them to the client prior
actually doing the write.
Jim
|