I have an application in python 2.5 which sends data through suds 0.3.6.
The problem is that the data contains non-ascii characters, so I need the following header to exist in the soap message:
Content-Type=”text/html; charset=”utf-8″
and the header that exists in the SOAP message is just:
Content-Type=”text/html”
I know that it is fixed in suds 0.4, but it requires Python2.6 and I NEED Python2.5 because I use CentOS and it needs that version. So the question is:
How could I change or add new HTTP headers to a SOAP message?
When you create the opener in urllib2, you can use some handlers to do whatever you want. For example, if you want to add a new header in suds, you should do something like this:
where HTTPSudsPreprocessor is your own handler, and it should look like this:
The methods you have to override depend on what you want to do. See urllib2 documentation in Python.org