Replaced deprecated URLEncodedUtils
This commit is contained in:
parent
ee26e23b31
commit
0524eed4b9
|
@ -60,7 +60,7 @@ import org.apache.hc.core5.http.NameValuePair;
|
|||
import org.apache.hc.core5.http.io.entity.ByteArrayEntity;
|
||||
import org.apache.hc.core5.http.io.entity.FileEntity;
|
||||
import org.apache.hc.core5.http.io.entity.InputStreamEntity;
|
||||
import org.apache.hc.core5.net.URLEncodedUtils;
|
||||
import org.apache.hc.core5.net.WWWFormCodec;
|
||||
import org.apache.hc.core5.util.Timeout;
|
||||
|
||||
/**
|
||||
|
@ -334,7 +334,7 @@ public class Request {
|
|||
}
|
||||
final ContentType contentType = charset != null ?
|
||||
ContentType.APPLICATION_FORM_URLENCODED.withCharset(charset) : ContentType.APPLICATION_FORM_URLENCODED;
|
||||
final String s = URLEncodedUtils.format(paramList, contentType.getCharset());
|
||||
final String s = WWWFormCodec.format(paramList, contentType.getCharset());
|
||||
return bodyString(s, contentType);
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ import java.util.List;
|
|||
import org.apache.hc.core5.http.ContentType;
|
||||
import org.apache.hc.core5.http.NameValuePair;
|
||||
import org.apache.hc.core5.http.io.entity.StringEntity;
|
||||
import org.apache.hc.core5.net.URLEncodedUtils;
|
||||
import org.apache.hc.core5.net.WWWFormCodec;
|
||||
|
||||
/**
|
||||
* An entity composed of a list of url-encoded pairs.
|
||||
|
@ -54,7 +54,7 @@ public class UrlEncodedFormEntity extends StringEntity {
|
|||
public UrlEncodedFormEntity(
|
||||
final Iterable<? extends NameValuePair> parameters,
|
||||
final Charset charset) {
|
||||
super(URLEncodedUtils.format(
|
||||
super(WWWFormCodec.format(
|
||||
parameters,
|
||||
charset != null ? charset : ContentType.APPLICATION_FORM_URLENCODED.getCharset()),
|
||||
charset != null ? ContentType.APPLICATION_FORM_URLENCODED.withCharset(charset) : ContentType.APPLICATION_FORM_URLENCODED);
|
||||
|
|
Loading…
Reference in New Issue