diff --git a/httpclient/http-client.go b/httpclient/http-client.go index a1db4be..0344eb8 100644 --- a/httpclient/http-client.go +++ b/httpclient/http-client.go @@ -34,6 +34,12 @@ type HttpExecution struct { ResponseBodyOutput io.Writer } +var validHttpResponse = map[int]bool{ + http.StatusOK: true, + http.StatusCreated: true, + http.StatusNoContent: true, +} + func setBasicAuthHeader(request *http.Request, username, password string) { if cmd.UsernameParam != "" { username = cmd.UsernameParam @@ -61,12 +67,6 @@ func createHttpClient(tlsEnabled bool, insecureAllowed bool) *http.Client { return &client } -var validHttpResponse = map[int]bool{ - http.StatusOK: true, - http.StatusCreated: true, - http.StatusNoContent: true, -} - func checkStatusResponse(httpStatus int) { if !validHttpResponse[httpStatus] { fmt.Println("HTTP ERROR", httpStatus, http.StatusText(httpStatus))