|
|
@ -4,6 +4,7 @@ import (
|
|
|
|
"bytes"
|
|
|
|
"bytes"
|
|
|
|
"encoding/json"
|
|
|
|
"encoding/json"
|
|
|
|
"io/ioutil"
|
|
|
|
"io/ioutil"
|
|
|
|
|
|
|
|
"log"
|
|
|
|
"net/http"
|
|
|
|
"net/http"
|
|
|
|
"strconv"
|
|
|
|
"strconv"
|
|
|
|
|
|
|
|
|
|
|
@ -48,8 +49,10 @@ func getResponseAsJSONArray(response *http.Response) ([]interface{}, error) {
|
|
|
|
if responseObject["message"] != nil {
|
|
|
|
if responseObject["message"] != nil {
|
|
|
|
return nil, portainer.Error(responseObject["message"].(string))
|
|
|
|
return nil, portainer.Error(responseObject["message"].(string))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
log.Printf("Response: %+v\n", responseObject)
|
|
|
|
return nil, ErrInvalidResponseContent
|
|
|
|
return nil, ErrInvalidResponseContent
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
|
|
|
|
log.Printf("Response: %+v\n", responseObject)
|
|
|
|
return nil, ErrInvalidResponseContent
|
|
|
|
return nil, ErrInvalidResponseContent
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|