You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by "DaanHoogland (via GitHub)" <gi...@apache.org> on 2023/11/02 15:02:24 UTC
Re: [PR] Convert GET to POST requests [cloudstack-cloudmonkey]
DaanHoogland commented on code in PR #140:
URL: https://github.com/apache/cloudstack-cloudmonkey/pull/140#discussion_r1380289018
##########
cmd/network.go:
##########
@@ -243,9 +252,18 @@ func NewAPIRequest(r *Request, api string, args []string, isAsync bool) (map[str
params.Add("sessionkey", sessionKey)
requestURL = fmt.Sprintf("%s?%s", r.Config.ActiveProfile.URL, encodeRequestParams(params))
config.Debug("NewAPIRequest API request URL:", requestURL)
- response, err = r.Client().Get(requestURL)
- if err != nil {
- return nil, err
+
+ if params.Has("password") || params.Has("userdata") {
+ requestURL = fmt.Sprintf("%s", r.Config.ActiveProfile.URL)
+ response, err = r.Client().PostForm(requestURL, params)
+ if err != nil {
+ return nil, err
+ }
+ } else {
+ response, err = r.Client().Get(requestURL)
+ if err != nil {
+ return nil, err
+ }
}
Review Comment:
this change is done twice. time for a method to call in both places?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org