Skip to content

Commit

Permalink
Fix Chinese garbled code issue when HTTP post input parameter is param
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangwejun committed Aug 10, 2023
1 parent 7f3c1a9 commit 58c93f2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ abstract class AbstractHttpClient(clientConfig: ClientConfig, clientName: String
if (v != null) nameValuePairs.add(new BasicNameValuePair(k, v.toString))
}
}
httpPut.setEntity(new UrlEncodedFormEntity(nameValuePairs))
httpPut.setEntity(new UrlEncodedFormEntity(nameValuePairs, Charset.defaultCharset))
}

if (StringUtils.isNotBlank(put.getRequestPayload)) {
Expand Down Expand Up @@ -343,7 +343,7 @@ abstract class AbstractHttpClient(clientConfig: ClientConfig, clientName: String
post.getParameters.asScala.foreach { case (k, v) =>
if (v != null) nvps.add(new BasicNameValuePair(k, v.toString))
}
httpPost.setEntity(new UrlEncodedFormEntity(nvps))
httpPost.setEntity(new UrlEncodedFormEntity(nvps, Charset.defaultCharset))
} else if (post.getFormParams.asScala.nonEmpty) {
post.getFormParams.asScala.foreach { case (k, v) =>
if (v != null) nvps.add(new BasicNameValuePair(k, v.toString))
Expand Down

0 comments on commit 58c93f2

Please sign in to comment.