From 9f227b7053d0245f066f432241e31af67576eb90 Mon Sep 17 00:00:00 2001 From: Shubham Tiwari Date: Thu, 20 Jun 2024 15:39:08 +0530 Subject: [PATCH] chore: remove duplicate setting of header params --- client/client.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/client/client.go b/client/client.go index 7519adc79..131003b37 100644 --- a/client/client.go +++ b/client/client.go @@ -143,7 +143,7 @@ func (c *Client) SendRequest(method string, rawURL string, data url.Values, //For HTTP GET Method there are no body parameters. All other parameters like query, path etc // are added as information in the url itself. Also while Content-Type is json, we are sending - // json body. In that case, data variable conatins all other parameters than body, which is the + // json body. In that case, data variable contains all other parameters than body, which is the //same case as GET method. In that case as well all parameters will be added to url if method == http.MethodGet || contentType == jsonContentType { if data != nil { @@ -178,10 +178,6 @@ func (c *Client) SendRequest(method string, rawURL string, data url.Values, } - if contentType == urlEncodedContentType { - req.Header.Add("Content-Type", urlEncodedContentType) - } - req.SetBasicAuth(c.basicAuth()) // E.g. "User-Agent": "twilio-go/1.0.0 (darwin amd64) go/go1.17.8"