UrlEncodedFormEntity constructors added in 4.2 no longer throw UnsupportedEncodingException

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1334630 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2012-05-06 13:58:20 +00:00
parent 93296a4779
commit 6920b38823
1 changed files with 5 additions and 7 deletions

View File

@ -58,8 +58,8 @@ public class UrlEncodedFormEntity extends StringEntity {
public UrlEncodedFormEntity (
final List <? extends NameValuePair> parameters,
final String charset) throws UnsupportedEncodingException {
super(URLEncodedUtils.format(parameters,
charset != null ? charset : HTTP.DEF_CONTENT_CHARSET.name()),
super(URLEncodedUtils.format(parameters,
charset != null ? charset : HTTP.DEF_CONTENT_CHARSET.name()),
ContentType.create(URLEncodedUtils.CONTENT_TYPE, charset));
}
@ -69,15 +69,14 @@ public class UrlEncodedFormEntity extends StringEntity {
*
* @param parameters iterable collection of name/value pairs
* @param charset encoding the name/value pairs be encoded with
* @throws UnsupportedEncodingException if the encoding isn't supported
*
* @since 4.2
*/
public UrlEncodedFormEntity (
final Iterable <? extends NameValuePair> parameters,
final Charset charset) {
super(URLEncodedUtils.format(parameters,
charset != null ? charset : HTTP.DEF_CONTENT_CHARSET),
super(URLEncodedUtils.format(parameters,
charset != null ? charset : HTTP.DEF_CONTENT_CHARSET),
ContentType.create(URLEncodedUtils.CONTENT_TYPE, charset));
}
@ -98,12 +97,11 @@ public class UrlEncodedFormEntity extends StringEntity {
* of parameters with the default encoding of {@link HTTP#DEFAULT_CONTENT_CHARSET}
*
* @param parameters iterable collection of name/value pairs
* @throws UnsupportedEncodingException if the default encoding isn't supported
*
* @since 4.2
*/
public UrlEncodedFormEntity (
final Iterable <? extends NameValuePair> parameters) throws UnsupportedEncodingException {
final Iterable <? extends NameValuePair> parameters) {
this(parameters, null);
}