Add the carbon api (#351)

This commit is contained in:
Asim Aslam
2022-01-07 11:55:41 +00:00
committed by GitHub
parent a093abaf5e
commit f505d4b857
15 changed files with 650 additions and 2 deletions

View File

@@ -40,7 +40,7 @@ func Get(url string, rsp interface{}) error {
return err
}
if resp.StatusCode != 200 {
if resp.StatusCode >= 400 {
return fmt.Errorf("Non 200 response %v: %v", resp.StatusCode, string(b))
}
@@ -78,7 +78,7 @@ func Post(url string, ureq, rsp interface{}) error {
return err
}
if resp.StatusCode != 200 {
if resp.StatusCode >= 400 {
return fmt.Errorf("Non 200 response %v: %v", resp.StatusCode, string(b))
}