HTTPCLIENT-1667: RequestBuilder does not take charset into account when creating UrlEncodedFormEntity

Contributed by Sergey Smith <smithsv at bk.ru>

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/branches/4.5.x@1692404 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2015-07-23 15:25:56 +00:00
parent c6be20feb0
commit 3b94921d03
1 changed files with 1 additions and 1 deletions

View File

@ -463,7 +463,7 @@ public class RequestBuilder {
if (parameters != null && !parameters.isEmpty()) {
if (entityCopy == null && (HttpPost.METHOD_NAME.equalsIgnoreCase(method)
|| HttpPut.METHOD_NAME.equalsIgnoreCase(method))) {
entityCopy = new UrlEncodedFormEntity(parameters, HTTP.DEF_CONTENT_CHARSET);
entityCopy = new UrlEncodedFormEntity(parameters, charset != null ? charset : HTTP.DEF_CONTENT_CHARSET);
} else {
try {
uriNotNull = new URIBuilder(uriNotNull)