Skip to content

Commit 431b328

Browse files
Mihhail VerhovtsovAdrian Cole
authored andcommitted
Set empty HttpEntity if request body is null.
Otherwise RequestBuilder will create HttpEntity from query parameters.
1 parent e70bb4f commit 431b328

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

httpclient/src/main/java/feign/httpclient/ApacheHttpClient.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ HttpUriRequest toHttpUriRequest(Request request, Request.Options options) throws
145145
}
146146

147147
requestBuilder.setEntity(entity);
148+
} else {
149+
requestBuilder.setEntity(new ByteArrayEntity(new byte[0]));
148150
}
149151

150152
return requestBuilder.build();

0 commit comments

Comments
 (0)