diff --git a/client/client.go b/client/client.go index 44070c0..f590550 100644 --- a/client/client.go +++ b/client/client.go @@ -154,7 +154,6 @@ func parameterToJson(obj interface{}) (string, error) { return string(jsonBuf), err } - // callAPI do the request. func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { return c.cfg.HTTPClient.Do(request) @@ -329,6 +328,9 @@ func (c *APIClient) prepareRequest( } func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } if s, ok := v.(*string); ok { *s = string(b) return nil