Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
helios-ag committed Jun 26, 2022
1 parent 5eb7e1a commit e16377a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tgstat.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ var NewRestRequest = func(c *Client, ctx context.Context, token, method, urlPath
}

body.Add("token", token)
reqBodyData, _ := json.Marshal(body)
reqBodyData := body.Encode()
// On `GET`, move the payload into the URL
if method == http.MethodGet {
uri += "?" + body.Encode()
reqBodyData = nil
reqBodyData = ""
}

req, err := http.NewRequest(method, uri, bytes.NewReader(reqBodyData))
req, err := http.NewRequest(method, uri, strings.NewReader(reqBodyData))

if err != nil {
return nil, err
Expand Down

0 comments on commit e16377a

Please sign in to comment.