Closed ghost closed 9 years ago
OK found it.
In Python 3 (3.4 at least), the Transport.send_request(...)
method from xmlrpc.client
(line ~1250) automatically adds the text/xml content type header. This is not the case in Python 2.7 and earlier.
The TransportMixIn
class from jsonrpclib.jsonrpc
should therefore override the send_request(...)
method.
Traffic capture of ServerProxy() to SimpleJSONRPCServer() shows multiple Content-Type headers: POST / HTTP/1.1 Host: localhost:8000 Accept-Encoding: gzip Content-Type: text/xml User-Agent: jsonrpclib/0.2.5 (Python3.4.2) Content-Type: application/json-rpc Content-Length: 105
A 3rd party server that inspects the Content-Type header sees the "text/xml" one, and rejects the request. Seems to be sneaking in from the underlying XMLRPC libraries. Thanks.