Cdrc - http enhancements

This commit is contained in:
DanB
2014-10-06 16:54:15 +02:00
parent 44c6a3f9fb
commit ca493e109f
3 changed files with 7 additions and 6 deletions

View File

@@ -278,6 +278,9 @@ func HttpJsonPost(url string, skipTlsVerify bool, content interface{}) ([]byte,
if err != nil {
return nil, err
}
if resp.StatusCode > 299 {
return respBody, fmt.Errorf("Unexpected status code received: %d", resp.StatusCode)
}
return respBody, nil
}