Skip to content

Commit 73d19cd

Browse files
authored
Merge pull request #226 from alahijani/master
Tolerate 200 OK with empty response
2 parents ad2e5d2 + 2fb8435 commit 73d19cd

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
@@ -321,6 +321,10 @@ func (client *APIClient) sendRequest(method string, path string, data string) (s
321321
return body, fmt.Errorf("unexpected response code '%d': %s", resp.StatusCode, body)
322322
}
323323

324+
if body == "" {
325+
return "{}", nil
326+
}
327+
324328
return body, nil
325329

326330
}

0 commit comments

Comments
 (0)