You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-commits@quetz.apache.org by nl...@apache.org on 2005/05/01 12:25:10 UTC

svn commit: r165479 - /httpd/mod_python/trunk/Doc/modpython2.tex /httpd/mod_python/trunk/Doc/modpython3.tex

Author: nlehuen
Date: Sun May  1 03:25:08 2005
New Revision: 165479

URL: http://svn.apache.org/viewcvs?rev=165479&view=rev
Log:
Documentation fix for MODPYTHON-39.

Modified:
    httpd/mod_python/trunk/Doc/modpython2.tex
    httpd/mod_python/trunk/Doc/modpython3.tex

Modified: httpd/mod_python/trunk/Doc/modpython2.tex
URL: http://svn.apache.org/viewcvs/httpd/mod_python/trunk/Doc/modpython2.tex?rev=165479&r1=165478&r2=165479&view=diff
==============================================================================
--- httpd/mod_python/trunk/Doc/modpython2.tex (original)
+++ httpd/mod_python/trunk/Doc/modpython2.tex Sun May  1 03:25:08 2005
@@ -223,6 +223,7 @@
     from mod_python import apache
 
     def handler(req):
+        req.content_type = 'text/plain'
         req.write("Hello World!")
         return apache.OK 
   \end{verbatim}

Modified: httpd/mod_python/trunk/Doc/modpython3.tex
URL: http://svn.apache.org/viewcvs/httpd/mod_python/trunk/Doc/modpython3.tex?rev=165479&r1=165478&r2=165479&view=diff
==============================================================================
--- httpd/mod_python/trunk/Doc/modpython3.tex (original)
+++ httpd/mod_python/trunk/Doc/modpython3.tex Sun May  1 03:25:08 2005
@@ -278,6 +278,11 @@
     This sets the content type to \samp{text/plain}. The default is usually
     \samp{text/html}, but since our handler doesn't produce any html,
     \samp{text/plain} is more appropriate.
+    \strong{Important:} you should \strong{always} make sure this is set
+    \strong{before} any call to \samp{req.write}. When you first call
+    \samp{req.write}, the response HTTP header is sent to the client and all
+    subsequent changes to the content type (or other HTTP headers) are simply
+    lost.
 
   \item
     \begin{verbatim}