Open lvnux opened 4 years ago
resp, err := api.client.Do(re) if err != nil { return nil, err } body, err = ioutil.ReadAll(resp.Body) return body, err
handle httpstatus of response maybe better:
resp, err := api.client.Do(re) if err != nil { return nil, err } body, err = ioutil.ReadAll(resp.Body) if resp.StatusCode != http.StatusOK { return nil, fmt.Errorf("rgw response httpstatus with code %d, %s", resp.StatusCode, string(body)) } return body, err
Good! Please create PR. Thanks
handle httpstatus of response maybe better: