Use reflection by default for HttpURLConnection request methods
@@ -1012,15 +1012,20 @@ public abstract class AbstractClient implements Client {
private void setRequestMethod(Message m, String httpMethod) {
m.put(Message.HTTP_REQUEST_METHOD, httpMethod);
- if (!KNOWN_METHODS.contains(httpMethod) && !m.containsKey("use.async.http.conduit")) {
+ if (!KNOWN_METHODS.contains(httpMethod)) {
+ if (!m.containsKey("use.async.http.conduit")) {
// if the async conduit is loaded then let it handle this method without users
// having to explicitly request it given that, without reflectively updating
// HTTPUrlConnection, it will not work without the async conduit anyway
m.put("use.async.http.conduit", true);
}
- //TODO: consider setting "use.httpurlconnection.method.reflection" here too -
+
+ if (!m.containsKey("use.httpurlconnection.method.reflection")) {
// if the async conduit is not loaded then the only way for the custom HTTP verb
// to be supported is to attempt to reflectively modify HTTPUrlConnection
+ m.put("use.httpurlconnection.method.reflection", true);
+ }
+ }
}
protected void setEmptyRequestPropertyIfNeeded(Message outMessage, Object body) {
