cgi and headers

Steve Holden steve at
Sun Aug 12 23:14:36 CEST 2007

kalin mintchev wrote:
> hi there...
> i'm starting to work with python cgi scripts using ajax.
> one problem i have is that the cgi module doesn;t do (apparently) anything
> without the -- print "Content-type: text/html\n" -- line in the script.
> the issue is that the output of the script has to be an xml file and not
> an html. it's not really a problem for any normal browser but the retarded
> explorer thing doesn;t process the xml unless it gets back the xml header.
> so my scripts work fine on mozilla but not in explorer because of the
> missing xml header.
> what would be the correct solution for this?
> thanks....
try "text/xml" or "text/html+xml" as content type. FWIW IE 6 actually 
required an extension of ".xml" on the output page to consider the page 
content to be XML, IIRC. IE 7 may be less broken, I haven't tried it 
much yet.


Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC/Ltd 
Skype: holdenweb
--------------- Asciimercial ------------------
Get on the web: Blog, lens and tag the Internet
Many services currently offer free registration
----------- Thank You for Reading -------------

More information about the Python-list mailing list