Skip to content

Commit

Permalink
Add debug param
Browse files Browse the repository at this point in the history
  • Loading branch information
neokore committed Jan 13, 2015
2 parents 74c10a6 + 4bbdbbf commit 654e4fa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion jsonrpc_requests/jsonrpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ class ProtocolError(JSONRPCError):

class Server(object):
"""A connection to a HTTP JSON-RPC server, backed by requests"""
def __init__(self, url, debug = False, **requests_kwargs):
def __init__(self, url, debug=False, **requests_kwargs):
requests_kwargs.setdefault('headers', {}).update({ # Merge user-defined headers with RFC-defined ones
'Content-Type': 'application/json',
'Accept': 'application/json-rpc',
})
self.request = functools.partial(requests.post, url, **requests_kwargs)
self.debug = debug
print "Debug is " + str(self.debug)

def send_request(self, method_name, is_notification, params):
"""Issue the HTTP request to the server and return the method result (if not a notification)"""
Expand Down

0 comments on commit 654e4fa

Please sign in to comment.