From b0f27792dece0a0201c4e945835983b0f2de5d70 Mon Sep 17 00:00:00 2001 From: Shubham Tiwari Date: Thu, 13 Jun 2024 13:24:19 +0530 Subject: [PATCH 1/3] chore: adding contentType in post and put --- twilio/base/client_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twilio/base/client_base.py b/twilio/base/client_base.py index c9e0f9c487..5f17c75406 100644 --- a/twilio/base/client_base.py +++ b/twilio/base/client_base.py @@ -184,7 +184,7 @@ def get_headers( # Types, encodings, etc. headers["Accept-Charset"] = "utf-8" - if method == "POST" and "Content-Type" not in headers: + if (method == "POST" or method == "PUT") and ("Content-Type" not in headers): headers["Content-Type"] = "application/x-www-form-urlencoded" if "Accept" not in headers: headers["Accept"] = "application/json" From fd54c5a84cde778ffd8281ebb7bbf40975ca5c17 Mon Sep 17 00:00:00 2001 From: Shubham Tiwari Date: Fri, 14 Jun 2024 19:12:15 +0530 Subject: [PATCH 2/3] chore: adding contentType in all except get --- twilio/base/client_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twilio/base/client_base.py b/twilio/base/client_base.py index 5f17c75406..d48114abf9 100644 --- a/twilio/base/client_base.py +++ b/twilio/base/client_base.py @@ -184,7 +184,7 @@ def get_headers( # Types, encodings, etc. headers["Accept-Charset"] = "utf-8" - if (method == "POST" or method == "PUT") and ("Content-Type" not in headers): + if method != "GET" and ("Content-Type" not in headers): headers["Content-Type"] = "application/x-www-form-urlencoded" if "Accept" not in headers: headers["Accept"] = "application/json" From a5589c899f069cc4456cc08082e35c4f7f3d7bd1 Mon Sep 17 00:00:00 2001 From: Shubham Tiwari Date: Tue, 18 Jun 2024 16:38:23 +0530 Subject: [PATCH 3/3] chore: adding contentType in put and post --- twilio/base/client_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twilio/base/client_base.py b/twilio/base/client_base.py index d48114abf9..5f17c75406 100644 --- a/twilio/base/client_base.py +++ b/twilio/base/client_base.py @@ -184,7 +184,7 @@ def get_headers( # Types, encodings, etc. headers["Accept-Charset"] = "utf-8" - if method != "GET" and ("Content-Type" not in headers): + if (method == "POST" or method == "PUT") and ("Content-Type" not in headers): headers["Content-Type"] = "application/x-www-form-urlencoded" if "Accept" not in headers: headers["Accept"] = "application/json"