8000 Merge branch '3' · gustafa/twilio-python@7e6cf54 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7e6cf54

Browse files
author
Kevin Burke
committed
Merge branch '3'
2 parents 6b97d3a + eaf6e59 commit 7e6cf54

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

tests/test_client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ def setUp(self):
2020
def test_request(self, mock):
2121
self.client.request("2010-04-01", method="GET")
2222
mock.assert_called_with("GET", "https://api.twilio.com/2010-04-01",
23-
headers={"User-Agent": 'twilio-python'}, params={},
24-
auth=AUTH, data=None)
23+
headers={"User-Agent": 'twilio-python',
24+
'Accept-Charset': 'utf-8'},
25+
params={}, auth=AUTH, data=None)
2526

2627
def test_connect_apps(self):
2728
self.assertIsInstance(self.client.connect_apps,

tests/test_make_request.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
get_headers = {
1313
"User-Agent": "twilio-python/%s" % (twilio.__version__),
14+
"Accept-Charset": "utf-8",
1415
"Accept": "application/json",
1516
}
1617

twilio/rest/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ def request(self, path, method=None, vars=None):
7777

7878
headers = {
7979
"User-Agent": "twilio-python",
80+
"Accept-Charset": "utf-8",
8081
}
8182

8283
resp = make_request(method, uri, auth=self.auth, data=data,

twilio/rest/resources/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def make_request(method, url, params=None, data=None, headers=None,
5858
resp, content = http.request(url, method, headers=headers, body=data)
5959

6060
# Format httplib2 request as requests object
61-
return Response(resp, content, url)
61+
return Response(resp, content.decode('utf-8'), url)
6262

6363

6464
def make_twilio_request(method, uri, **kwargs):
@@ -67,6 +67,7 @@ def make_twilio_request(method, uri, **kwargs):
6767
"""
6868
headers = kwargs.get("headers", {})
6969
headers["User-Agent"] = "twilio-python/%s" % twilio.__version__
70+
headers["Accept-Charset"] = "utf-8"
7071

7172
if method == "POST" and "Content-Type" not in headers:
7273
headers["Content-Type"] = "application/x-www-form-urlencoded"

0 commit comments

Comments
 (0)
0