From 010849ba96d54cad4a0b44cdf17ce7ababf6cf93 Mon Sep 17 00:00:00 2001 From: Shubham Tiwari Date: Thu, 13 Jun 2024 13:57:26 +0530 Subject: [PATCH 1/5] chore: adding contentType in post and put --- src/base/BaseTwilio.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/BaseTwilio.ts b/src/base/BaseTwilio.ts index d6a4ee757..2c6d6a6bf 100644 --- a/src/base/BaseTwilio.ts +++ b/src/base/BaseTwilio.ts @@ -170,7 +170,7 @@ namespace Twilio { }); headers["Accept-Charset"] = "utf-8"; - if (opts.method === "post" && !headers["Content-Type"]) { + if ((opts.method === "post" || opts.method === "put") && !headers["Content-Type"]) { headers["Content-Type"] = "application/x-www-form-urlencoded"; } From d0ce60dac26139dd287de7eb05ea966263d96a02 Mon Sep 17 00:00:00 2001 From: Shubham Tiwari Date: Thu, 13 Jun 2024 14:04:44 +0530 Subject: [PATCH 2/5] chore: ran prettier --- src/base/BaseTwilio.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/base/BaseTwilio.ts b/src/base/BaseTwilio.ts index 2c6d6a6bf..f6651c8a7 100644 --- a/src/base/BaseTwilio.ts +++ b/src/base/BaseTwilio.ts @@ -170,7 +170,10 @@ namespace Twilio { }); headers["Accept-Charset"] = "utf-8"; - if ((opts.method === "post" || opts.method === "put") && !headers["Content-Type"]) { + if ( + (opts.method === "post" || opts.method === "put") && + !headers["Content-Type"] + ) { headers["Content-Type"] = "application/x-www-form-urlencoded"; } From 0779b4c5f4c2c291e26e22f215cf07497bf882d5 Mon Sep 17 00:00:00 2001 From: Shubham Tiwari Date: Fri, 14 Jun 2024 18:48:47 +0530 Subject: [PATCH 3/5] chore: setting contentType for all except get --- src/base/BaseTwilio.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/base/BaseTwilio.ts b/src/base/BaseTwilio.ts index f6651c8a7..a6d2f26b7 100644 --- a/src/base/BaseTwilio.ts +++ b/src/base/BaseTwilio.ts @@ -171,8 +171,7 @@ namespace Twilio { headers["Accept-Charset"] = "utf-8"; if ( - (opts.method === "post" || opts.method === "put") && - !headers["Content-Type"] + opts.method !== "get" && !headers["Content-Type"] ) { headers["Content-Type"] = "application/x-www-form-urlencoded"; } From eef932ffe90a2d1bf1cf7c8afc522d3d086af227 Mon Sep 17 00:00:00 2001 From: Shubham Tiwari Date: Tue, 18 Jun 2024 10:45:13 +0530 Subject: [PATCH 4/5] chore: removing commit --- src/base/BaseTwilio.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/base/BaseTwilio.ts b/src/base/BaseTwilio.ts index a6d2f26b7..98d6d2fa6 100644 --- a/src/base/BaseTwilio.ts +++ b/src/base/BaseTwilio.ts @@ -170,11 +170,11 @@ namespace Twilio { }); headers["Accept-Charset"] = "utf-8"; - if ( - opts.method !== "get" && !headers["Content-Type"] - ) { - headers["Content-Type"] = "application/x-www-form-urlencoded"; - } + // if ( + // opts.method !== "get" && !headers["Content-Type"] + // ) { + // headers["Content-Type"] = "application/x-www-form-urlencoded"; + // } if (!headers["Accept"]) { headers["Accept"] = "application/json"; From ed8b76f1ef872084889491a2795c73498cd488d6 Mon Sep 17 00:00:00 2001 From: Shubham Tiwari Date: Tue, 18 Jun 2024 16:41:30 +0530 Subject: [PATCH 5/5] chore: setting contentType for post and put --- src/base/BaseTwilio.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/base/BaseTwilio.ts b/src/base/BaseTwilio.ts index 98d6d2fa6..f6651c8a7 100644 --- a/src/base/BaseTwilio.ts +++ b/src/base/BaseTwilio.ts @@ -170,11 +170,12 @@ namespace Twilio { }); headers["Accept-Charset"] = "utf-8"; - // if ( - // opts.method !== "get" && !headers["Content-Type"] - // ) { - // headers["Content-Type"] = "application/x-www-form-urlencoded"; - // } + if ( + (opts.method === "post" || opts.method === "put") && + !headers["Content-Type"] + ) { + headers["Content-Type"] = "application/x-www-form-urlencoded"; + } if (!headers["Accept"]) { headers["Accept"] = "application/json";