Skip to content

Commit

Permalink
do not send "null" as body in request without body (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
thesyncim authored and bogdan-d committed Jan 21, 2020
1 parent 15a03d4 commit 69a5ec9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@ func (c *Client) newRequest(method, path string, params url.Values, data interfa
}

c.setHeaders(r)

switch t := data.(type) {
case nil:
r.Body = nil

case easyjson.Marshaler:
b, err := easyjson.Marshal(t)
if err != nil {
Expand Down

0 comments on commit 69a5ec9

Please sign in to comment.