[mod_python] Apache Status-Code and headers

Graham Dumpleton grahamd at dscpl.com.au
Wed Feb 15 16:20:48 EST 2006


On 15/02/2006, at 11:05 PM, Lars Eriksen wrote:

> The manual says:
>
> *set_content_length*( 	len)
>
> Sets the value of req.clength and the "Content-Length" header to  
> len. Note that after the headers have been sent out (which happens  
> just before the first byte of the body is written, i.e. first call  
> to req.write()), calling the method is meaningless.
>
> Now how can returning the status code, e.g. apache.OK, after you  
> call req.write(...), have any effect if the headers have already  
> been sent out?

Return apache.OK means something different to returning a HTTP 200  
result.
It is returning information to the server, not to the client.

Have a read through:

   http://162.105.203.19/apache-doc/27.htm#BIN74


Graham


More information about the Mod_python mailing list