[Twisted-web] How to generate xhtml code with Resource.render?

Dominic Fox dominic.fox at gmail.com
Fri Aug 27 09:58:01 MDT 2004


For xhtml, you need to find out whether the client will accept
application/xml+xhtml. If it will, then change the MIME type to that:

   request.setHeader('Content-type', 'application/xml+xhtml')

Otherwise, make sure it's text/html. You may need to do this by force,
if the file extension isn't '.htm' or '.html'.

Dominic

On Fri, 27 Aug 2004 11:38:55 -0400, Christopher Armstrong
<radeex at gmail.com> wrote:
> On Fri, 27 Aug 2004 16:39:53 +0200 (MEST), Krzystof Nowak
> <knowak at mail.desy.de> wrote:
> > browser dosent seem to understand that its xhtml code. I think I'm missing
> > something very easy, maybe I'm not properly understand philosophy of xhtml
> > or python.web. Do you know how to manage with this problem?
> 
> I'll guess mime-type. You might have to set it to something other than
> the default, text/html. Dunno what to, though.
> 
> --
>  Twisted | Christopher Armstrong: International Man of Twistery
>   Radix  |          Release Manager,  Twisted Project
> ---------+            http://radix.twistedmatrix.com
> 
> 
> 
> _______________________________________________
> Twisted-web mailing list
> Twisted-web at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
> 


-- 
// Dream in black and white -
// model cities, shooting up in the air



More information about the Twisted-web mailing list