davsclaus commented on code in PR #27331:
URL: https://github.com/apache/camel/pull/27331#discussion_r4177178626


##########
components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java:
##########
@@ -713,6 +715,28 @@ private boolean isCreateNewURL(Exchange exchange) {
         return create;
     }
 
+    /**
+     * The body as a stream for the request entity. A Map or a List (a body 
unmarshalled from JSON, or built as a map)
+     * cannot become one, and the converter's message only names the 
conversion: say what to do (CAMEL-25309).
+     */
+    private static InputStream mandatoryBodyStream(Exchange exchange, Message 
in) throws InvalidPayloadException {
+        try {
+            return in.getMandatoryBody(InputStream.class);
+        } catch (InvalidPayloadException e) {
+            Object body = in.getBody();
+            if (body instanceof Map || body instanceof Collection) {
+                InvalidPayloadException answer = new InvalidPayloadException(
+                        exchange, InputStream.class, in,
+                        "a " + (body instanceof Map ? "Map" : "List")
+                                                         + " is not an HTTP 
request body: marshal it to JSON first "

Review Comment:
   Applied in 85c987049d95: a Set or other Collection is now named as such, 
List stays List.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to