diff --git a/harvest/harvest.py b/harvest/harvest.py index 9f4d8a0..cec3a07 100644 --- a/harvest/harvest.py +++ b/harvest/harvest.py @@ -1021,8 +1021,9 @@ def _request(self, method='GET', path='/', data=None, files=None): del(kwargs['headers']['Content-Type']) kwargs['files'] = files kwargs['data'] = data - else: + if data is not None: kwargs['data'] = json.dumps(data) + requestor = requests @@ -1084,4 +1085,4 @@ def _request(self, method='GET', path='/', data=None, files=None): return resp else: - raise HarvestError('Unsupported HTTP response code. {0} {1}'.format(resp.status_code, resp.url)) + raise HarvestError('Unsupported HTTP response code. {0} {1} {2}'.format(resp.status_code, resp.url, resp.text))