|
|
@ -34,7 +34,11 @@ class HttpApi:
|
|
|
|
headers = {'Content-Type': 'application/json-rpc'}
|
|
|
|
headers = {'Content-Type': 'application/json-rpc'}
|
|
|
|
|
|
|
|
|
|
|
|
response = self.connection.send('/command-api', request, headers=headers, method='POST')
|
|
|
|
response = self.connection.send('/command-api', request, headers=headers, method='POST')
|
|
|
|
response = json.loads(to_text(response.read()))
|
|
|
|
response_text = to_text(response.read())
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
response = json.loads(response_text)
|
|
|
|
|
|
|
|
except ValueError:
|
|
|
|
|
|
|
|
raise ConnectionError('Response was not valid JSON, got {0}'.format(response_text))
|
|
|
|
results = handle_response(response)
|
|
|
|
results = handle_response(response)
|
|
|
|
|
|
|
|
|
|
|
|
if self._become:
|
|
|
|
if self._become:
|
|
|
|