Am 25.09.2016 um 00:06 schrieb Philippe Mouawad:
Hello,
Working on Bug 60015, I noticed that we have some issues in this code:
if (httpRequest instanceof HttpPost) {
String postBody = sendPostData((HttpPost)httpRequest);
result.setQueryString(postBody);
} else if (httpRequest instanceof HttpEntityEnclosingRequestBase) {
String entityBody =
sendEntityData((HttpEntityEnclosingRequestBase) httpRequest);
result.setQueryString(entityBody);
}
1/ It appears that sendEntityData is partly a copy paste of the "else { //
not multipart" part.
2/ multipart/form should be available for other methods than POST, I think
all methods except GET, HEAD, UNLOCK, COPY can use multipart/form format
+1 on simplifying it and combining the POST and PUT-like parts.
A lot of people seem to want to send multipart/form requests while using
PUT.
Multipart should not be the default for PUT, though. And I don't think
it has to be in this release, as the inability to send multipart with
PUT is quite old and I am afraid of changing too much without proper
testing.
Felix