473,465 Members | 2,123 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to change header : content type / MIME

4 New Member
my script looks like this:

Expand|Select|Wrap|Line Numbers
  1. def getXML(self, param):
  2.     feed = urllib.urlopen (param)
  3.     ergebnis = feed.read ()
  4.     zusammen = '<?xml version="1.0" encoding="iso-8859-1" ?>\n'+ergebnis
  5.     return zusammen
ok here i put something in the content but still IE handels ist like text. so i want to but something in the header so he renders it like this:

http://www.soupandfish.net:11111/test/search.xml

by now it renders it like that:

http://www.unsaleable.com/soupandfis...40&designer=mm
Oct 11 '07 #1
1 2136
stelegraph
4 New Member
my solution:


Expand|Select|Wrap|Line Numbers
  1. import urllib
  2. import cgi
  3. from xml.dom import minidom
  4.  
  5. def getXML2(self, param):
  6.     param = param.replace('_', '=')
  7.     param = param.replace('-', '&')
  8.     urlnew = 'http://www.unsaleable.com/soupandfish/search?'+param
  9.     request = self.REQUEST
  10.     response = request.RESPONSE
  11.     feed = urllib.urlopen (urlnew)
  12.     ergebnis = feed.read ()
  13.     zusammen = '<?xml version="1.0" encoding="ISO-8859-1" ?>\n'+ergebnis
  14.     response.setHeader('content-type', 'text/xml')
  15.     response.setHeader('encoding', 'ISO-8859-1')
  16.     response.write(ergebnis)
Oct 12 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

35
by: The Bicycling Guitarist | last post by:
My web site has not been spidered by Googlebot since April 2003. The site in question is at www.TheBicyclingGuitarist.net/ I received much help from this NG and the stylesheets NG when updating the...
5
by: manokumar | last post by:
hiye, i notice that some if not all of my folders in winxp pro. are set as read only and its giving me some problem with development. so as the natural thing, i unchecked the read only option and...
2
by: Joel D Kraft | last post by:
I'm using controls in my ASP.NET application from a couple of vendors. Between the vendors and thier versioning, I've set up subfolders under my bin directory: bin bin\Infragistics\v5.2...
3
by: Hans Merkl | last post by:
Hi, I was wondering if it's possible to bind the header text of a GridView column to a method of an object I have. At the moment I am setting the header texts in Page_Load but I was wondering if...
5
by: joeblast | last post by:
I have a Web service that gets the financial periods and hold a reference to a disconnected dataset built at initialization. Web methods work on the dataset inside the web service. Everything is...
21
by: cman | last post by:
does anyone know why i can't generate images with: header("Content-type:image/jpeg"); imagejpeg($img_number); i've tried different examples but i always get a text output as if the header...
7
by: Ramon | last post by:
Hello, when I send an email using the mail() function, I get a Runtime Notice: date() : It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ...
3
by: TomislaW | last post by:
I am sending word document with e-mail from asp.net 2.0 application. I read doc file like this:FileStream fs = System.IO.File.Open(docPath,FileMode.Open,FileAccess.Read,FileShare.Read); Then...
0
by: Nobody | last post by:
I have an application that processes MIME messages. It reads a message from a file, looks for a text/html and text/plain parts in it, performs some processing on these parts, and outputs the new...
1
realin
by: realin | last post by:
Hiya all, I m using pop3.class.php5.inc class from php classes I am using their simple script, but i cant really get the sender information in the headers. Wht can be the error, i am able to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.