Skip to content

Commit

Permalink
Replaced deprecated URLEncodedUtils
Browse files Browse the repository at this point in the history
  • Loading branch information
ok2c committed Sep 27, 2020
1 parent ee26e23 commit 0524eed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -60,7 +60,7 @@
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;

/**
Expand Down Expand Up @@ -334,7 +334,7 @@ public Request bodyForm(final Iterable <? extends NameValuePair> formParams, fin
}
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);
}

Expand Down
Expand Up @@ -32,7 +32,7 @@
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.
Expand All @@ -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);
Expand Down

0 comments on commit 0524eed

Please sign in to comment.