Skip to content

Commit

Permalink
chore: process query params for put also
Browse files Browse the repository at this point in the history
  • Loading branch information
tiwarishubham635 committed Dec 2, 2024
1 parent d1a5a8a commit ff519a2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,20 +164,20 @@ func (c *Client) SendRequest(method string, rawURL string, data url.Values,
} else {
//Here the HTTP POST methods which is not having json content type are processed
//All the values will be added in data and encoded (all body, query, path parameters)
if method == http.MethodPost {
if method == http.MethodPost || method == http.MethodPut {
valueReader = strings.NewReader(data.Encode())
}
credErr := c.validateCredentials()
if credErr != nil {
return nil, credErr
}
req, err = http.NewRequest(method, u.String(), valueReader)
if err != nil {
return nil, err
}

}

credErr := c.validateCredentials()
if credErr != nil {
return nil, credErr
}
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 ff519a2

Please sign in to comment.