joshmarshall / jsonrpclib

A Python JSON-RPC over HTTP that mirrors xmlrpclib syntax.
Other
447 stars 144 forks source link

Ability to override Content-Type of RPC request #35

Closed Leden closed 5 years ago

Leden commented 9 years ago

Some JSON-RPC APIs (Atlassian Confluence in my case) do require Content-Type other than application/json-rpc to work. That little patch adds the ability to make them happy.

ServerProxy can be instantiated as usual but with additional keyword-only parameter content_type containing the string to be passed under Content-Type HTTP header value:

server = jsonrpclib.jsonrpc.ServerProxy(endpoint, content_type="application/json")