X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/38a0f5e77f2190487d03d6538337d3b7055fd1e8..e065d5863b9b36c1cd221f676baffa57e20e7498:/sdk/go/arvados/client.go diff --git a/sdk/go/arvados/client.go b/sdk/go/arvados/client.go index ea3cb6899e..5ec828667f 100644 --- a/sdk/go/arvados/client.go +++ b/sdk/go/arvados/client.go @@ -217,6 +217,8 @@ func (c *Client) DoAndDecode(dst interface{}, req *http.Request) error { return err } switch { + case resp.StatusCode == http.StatusNoContent: + return nil case resp.StatusCode == http.StatusOK && dst == nil: return nil case resp.StatusCode == http.StatusOK: @@ -321,9 +323,8 @@ func (c *Client) RequestAndDecodeContext(ctx context.Context, dst interface{}, m if c.APIHost == "" { if c.loadedFromEnv { return errors.New("ARVADOS_API_HOST and/or ARVADOS_API_TOKEN environment variables are not set") - } else { - return errors.New("arvados.Client cannot perform request: APIHost is not set") } + return errors.New("arvados.Client cannot perform request: APIHost is not set") } urlString := c.apiURL(path) urlValues, err := anythingToValues(params)