This commit is contained in:
@@ -1300,16 +1300,11 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
* @return String
|
* @return String
|
||||||
*/
|
*/
|
||||||
public String getParametersToString(String prefix) {
|
public String getParametersToString(String prefix) {
|
||||||
final StringBuilder sb = new StringBuilder();
|
byte[] rbs = queryBytes;
|
||||||
getParameters().forEach((k, v) -> {
|
if (rbs == null || rbs.length < 1) return "";
|
||||||
if (sb.length() > 0) sb.append('&');
|
Charset charset = this.context.getCharset();
|
||||||
try {
|
String str = charset == null ? new String(rbs, StandardCharsets.UTF_8) : new String(rbs, charset);
|
||||||
sb.append(k).append('=').append(URLEncoder.encode(v, "UTF-8"));
|
return (prefix == null) ? str : (prefix + str);
|
||||||
} catch (IOException ex) {
|
|
||||||
throw new RuntimeException(ex);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return (sb.length() > 0 && prefix != null) ? (prefix + sb) : sb.toString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user