Skip to content

Commit

Permalink
chore: remove duplicate setting of header params
Browse files Browse the repository at this point in the history
  • Loading branch information
tiwarishubham635 committed Jun 20, 2024
1 parent a489a1c commit 9f227b7
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 9f227b7

Please sign in to comment.