Skip to content

Commit 2fb8435

Browse files
author
Ali Lahijani
committed
Tolerate 200 OK with empty response
1 parent b881c1c commit 2fb8435

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

restapi/api_client.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,10 @@ func (client *APIClient) sendRequest(method string, path string, data string) (s
319319
return body, fmt.Errorf("unexpected response code '%d': %s", resp.StatusCode, body)
320320
}
321321

322+
if body == "" {
323+
return "{}", nil
324+
}
325+
322326
return body, nil
323327

324328
}

0 commit comments

Comments
 (0)