Skip to content

Commit

Permalink
Patched 'null' value in body for GET requests
Browse files Browse the repository at this point in the history
Added additional output for 400 errors
  • Loading branch information
mimartin12 committed Aug 25, 2021
1 parent 7073045 commit 068057f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions harvest/harvest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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))

0 comments on commit 068057f

Please sign in to comment.