Skip to content

Commit

Permalink
feat: add application/json support for client
Browse files Browse the repository at this point in the history
  • Loading branch information
manisha1997 committed Nov 27, 2023
1 parent 74e6a34 commit 833dee4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion twilio/http/http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,16 @@ def request(
"method": method.upper(),
"url": url,
"params": params,
"data": data,
"headers": headers,
"auth": auth,
"hooks": self.request_hooks,
}

if headers is not None and 'Content-Type' in headers.keys() and headers['Content-Type'] == 'application/json':
kwargs['json'] = data
else:
kwargs['data'] = data

self.log_request(kwargs)

self._test_only_last_response = None
Expand Down

0 comments on commit 833dee4

Please sign in to comment.