8000 Do json extension appending correctly · sangsiri/twilio-python@b5b1952 · GitHub
[go: up one dir, main page]

Skip to content

Commit b5b1952

Browse files
committed
Do json extension appending correctly
1 parent 5ffbf69 commit b5b1952

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

twilio/rest/resources/base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def make_twilio_request(method, uri, **kwargs):
143143

144144
kwargs["headers"] = headers
145145

146-
if "Accept" not in headers and not kwargs.pop('use_json_extension', False):
146+
if "Accept" not in headers and kwargs.pop('use_json_extension', False):
147147
headers["Accept"] = "application/json"
148148
uri += ".json"
149149

@@ -286,6 +286,8 @@ def __str__(self):
286286

287287
class NextGenInstanceResource(InstanceResource):
288288

289+
use_json_extension = False
290+
289291
def __init__(self, *args, **kwargs):
290292
super(NextGenInstanceResource, self).__init__(*args, **kwargs)
291293

@@ -466,6 +468,7 @@ class NextGenListResource(ListResource):
466468

467469
name = "Resources"
468470
instance = NextGenInstanceResource
471+
use_json_extension = False
469472

470473
def __init__(self, *args, **kwargs):
471474
super(NextGenListResource, self).__init__(*args, **kwargs)

0 commit comments

Comments
 (0)
0