Updated file layout to match CW API documentation

This commit is contained in:
2018-06-22 14:14:21 -06:00
parent 8adc3a69a1
commit a66ba7ca89
5 changed files with 186 additions and 20 deletions

View File

@ -12,7 +12,7 @@ import (
//Checks for HTTP errors, and if all looks good, returns the body of the HTTP response as a byte slice
//TBD: Needs to accept 201 and 204 (returned for Create and Delete operations)
func getHTTPResponseBody(resp *http.Response) []byte {
if resp.StatusCode != http.StatusOK {
if (resp.StatusCode != http.StatusOK) && (resp.StatusCode != http.StatusCreated) && (resp.StatusCode != http.StatusNoContent) {
out := fmt.Sprintf("CW API returned HTTP Status Code %s\n%s", resp.Status, resp.Body)
log.Fatal(out)
return make([]byte, 0)