Fix bug in POST

57-refactor-conversion 0.11.3
J. Fernando Sánchez 6 years ago
parent a82e4ed440
commit 748d1a00bd

@ -69,7 +69,7 @@ def encoded_url(url=None, base=None):
if request.method == 'GET':
url = request.full_path[1:] # Remove the first slash
else:
hash(frozenset(request.parameters.items()))
hash(frozenset(tuple(request.parameters.items())))
code = 'hash:{}'.format(hash)
code = code or base64.urlsafe_b64encode(url.encode()).decode()

@ -25,7 +25,11 @@ class Client(object):
def request(self, path=None, method='GET', **params):
url = '{}{}'.format(self.endpoint.rstrip('/'), path)
response = requests.request(method=method, url=url, params=params)
if method == 'POST':
response = requests.post(url=url, data=params)
else:
response = requests.request(method=method, url=url, params=params)
try:
resp = models.from_dict(response.json())
except Exception as ex:

Loading…
Cancel
Save