Skip to content

Commit

Permalink
chore: pass query params in delete
Browse files Browse the repository at this point in the history
  • Loading branch information
tiwarishubham635 committed Nov 18, 2024
1 parent 10d3610 commit 5630d25
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func (c *Client) SendRequest(method string, rawURL string, data url.Values,
// are added as information in the url itself. Also while Content-Type is json, we are sending
// 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 method == http.MethodGet || method == http.MethodDelete || contentType == jsonContentType {
if data != nil {
v, _ := form.EncodeToStringWith(data, delimiter, escapee, keepZeros)
s := delimitingRegex.ReplaceAllString(v, "")
Expand Down
4 changes: 2 additions & 2 deletions client/request_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ func (c *RequestHandler) Get(path string, queryData url.Values, headers map[stri
return c.sendRequest(http.MethodGet, path, queryData, headers)
}

func (c *RequestHandler) Delete(path string, nothing url.Values, headers map[string]interface{}) (*http.Response, error) {
return c.sendRequest(http.MethodDelete, path, nil, headers)
func (c *RequestHandler) Delete(path string, queryData url.Values, headers map[string]interface{}) (*http.Response, error) {
return c.sendRequest(http.MethodDelete, path, queryData, headers)
}

0 comments on commit 5630d25

Please sign in to comment.