Replaced the return of Call[Method]() by the stored value of the resp.Body
This commit is contained in:
parent
79aec86f5f
commit
a9c82bd261
@ -92,11 +92,17 @@ func (caller *HTTPCaller) CallGet(url string, subpath string, types ...string) (
|
||||
|
||||
// CallPut calls the DELETE method on the HTTP server
|
||||
func (caller *HTTPCaller) CallDelete(url string, subpath string) ([]byte, error) {
|
||||
resp, err := http.NewRequest("DELETE", url+subpath, nil)
|
||||
if err != nil || resp == nil || resp.Body == nil {
|
||||
req, err := http.NewRequest("DELETE", url+subpath, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client := &http.Client{}
|
||||
resp, err := client.Do(req)
|
||||
if err != nil || req == nil || req.Body == nil {
|
||||
return nil, err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
err = caller.StoreResp(resp)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Loading…
Reference in New Issue
Block a user