Skip to content

Commit

Permalink
chore: adding contentType in post and put (#1024)
Browse files Browse the repository at this point in the history
* chore: adding contentType in post and put
  • Loading branch information
tiwarishubham635 authored Jun 18, 2024
1 parent 55db7c2 commit 7d1f4ec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/base/BaseTwilio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ 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";
}

Expand Down

0 comments on commit 7d1f4ec

Please sign in to comment.