Github user geomacy commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/715#discussion_r120019201
  
    --- Diff: 
core/src/main/java/org/apache/brooklyn/core/effector/http/HttpCommandEffector.java
 ---
    @@ -181,7 +204,19 @@ private HttpRequest buildHttpRequest(String httpVerb, 
URI uri, Map<String, Strin
                     if (contentType == null || 
contentType.equalsIgnoreCase(APPLICATION_JSON)) {
                         LOG.warn("Content-Type not specified. Using {}, as 
default (continuing)", APPLICATION_JSON);
                         body = toJsonString(payload);
    -                } else if 
(!contentType.equalsIgnoreCase(APPLICATION_JSON)) {
    +                } else if 
(contentType.equalsIgnoreCase(APPLICATION_X_WWW_FORM_URLENCODE)) {
    +                    if (payload instanceof Map) {
    +                        for (Map.Entry<String, String> entry : 
((Map<String, String>) payload).entrySet()) {
    +                            try {
    +                                if (!body.equals("")) body += "&";
    +                                body += URLEncoder.encode(entry.getKey(), 
StandardCharsets.UTF_8.toString()) + "=" + URLEncoder.encode(entry.getValue(), 
StandardCharsets.UTF_8.toString());
    --- End diff --
    
    I managed to get myself misled by the `convertToUri` at the start of the 
diff above, and missed the fact that this bit of code is down inside 
`buildHttpRequest`. Sorry about that!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to