I want to locally override _response method of class JsonRPCDispatcher in http.py.
class JsonRPCDispatcher(Dispatcher):
routing_type = 'json'
def _response(self, result=None, error=None):
response = {'jsonrpc': '2.0', 'id': self.request_id}
if error is not None:
response['error'] = error
if result is not None:
response['result'] = result
return self.request.make_json_response(response)
I want to replace the whole method locally. How to do this?