Skip to content

Commit

Permalink
fix put json
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Badi committed Jun 20, 2016
1 parent 8fcb63a commit f76bcb3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mailjet/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def create(self, data=None, filters=None, id=None, action_id=None, **kwargs):
return api_call(self._auth, 'post', self._url, headers=self.headers, resource_id=id, data=data, action=self.action, action_id=action_id, filters=filters, **kwargs)

def update(self, id, data, filters=None, action_id=None, **kwargs):
if self.headers['Content-type'] == 'application/json':
data = json.dumps(data)
return api_call(self._auth, 'put', self._url, resource_id=id, headers=self.headers, data=data, action=self.action, action_id=action_id, filters=filters, **kwargs)

def delete(self, id, **kwargs):
Expand Down Expand Up @@ -84,8 +86,6 @@ def api_call(auth, method, url, headers, data=None, filters=None, resource_id=No
try:
response = req_method(url, data=data, params=filters, headers=headers, auth=auth,
timeout=timeout, verify=False, stream=False)

# return parse_response(response, debug=debug)
return response

except requests.exceptions.Timeout:
Expand Down

0 comments on commit f76bcb3

Please sign in to comment.