[Twisted-web] XML-RPC server returns text/html on fault

Remi Cool mailinglists at smartology.nl
Thu Dec 28 03:02:49 CST 2006

I've run into a problem with a twisted XML-RPC server.

When you request a (xml-rpc) function that doesn't exist, the response
from the twisted server has the wrong content type so that the xml-rpc
client can't handle it properly.

(using a simple python xml-rpc client - verbose=True)

reply: 'HTTP/1.0 200 OK\r\n'
header: Date: Thu, 28 Dec 2006 08:50:36 GMT
header: Content-length: 282
header: Content-type: text/html; charset=UTF-8
header: Server: TwistedWeb/2.2.0
body: "<?xml
echos not
ERROR <Fault 8001: 'function echos not found'>

How can I change this behaviour so that it returns a proper xml-rpc
response with a text/xml content-type header?

- Remi -

More information about the Twisted-web mailing list