|
105 | 105 | import org.apache.http.ssl.SSLContexts; |
106 | 106 | import org.apache.http.util.TextUtils; |
107 | 107 | import org.htmlunit.WebRequest.HttpHint; |
| 108 | +import org.htmlunit.http.HttpUtils; |
108 | 109 | import org.htmlunit.httpclient.HtmlUnitCookieSpecProvider; |
109 | 110 | import org.htmlunit.httpclient.HtmlUnitCookieStore; |
110 | 111 | import org.htmlunit.httpclient.HtmlUnitRedirectStrategie; |
111 | 112 | import org.htmlunit.httpclient.HtmlUnitSSLConnectionSocketFactory; |
112 | | -import org.htmlunit.httpclient.HttpClientConverter; |
113 | 113 | import org.htmlunit.httpclient.SocksConnectionSocketFactory; |
114 | 114 | import org.htmlunit.util.KeyDataPair; |
115 | 115 | import org.htmlunit.util.MimeType; |
@@ -296,17 +296,15 @@ private HttpUriRequest makeHttpMethod(final WebRequest webRequest, final HttpCli |
296 | 296 | // POST, PUT and PATCH |
297 | 297 | if (httpMethod instanceof HttpEntityEnclosingRequest) { |
298 | 298 | // developer note: |
299 | | - // this has to be in sync with |
300 | | - // org.htmlunit.WebRequest.getRequestParameters() |
| 299 | + // this has to be in sync with org.htmlunit.WebRequest.getRequestParameters() |
301 | 300 |
|
302 | 301 | final HttpEntityEnclosingRequest method = (HttpEntityEnclosingRequest) httpMethod; |
303 | 302 |
|
304 | 303 | if (webRequest.getEncodingType() == FormEncodingType.URL_ENCODED && method instanceof HttpPost) { |
305 | 304 | final HttpPost postMethod = (HttpPost) method; |
306 | 305 | if (webRequest.getRequestBody() == null) { |
307 | 306 | final List<NameValuePair> pairs = webRequest.getRequestParameters(); |
308 | | - final String query = URLEncodedUtils.format( |
309 | | - HttpClientConverter.nameValuePairsToHttpClient(pairs), charset); |
| 307 | + final String query = HttpUtils.toQueryFormFields(pairs, charset); |
310 | 308 |
|
311 | 309 | final StringEntity urlEncodedEntity; |
312 | 310 | if (webRequest.hasHint(HttpHint.IncludeCharsetInContentTypeHeader)) { |
@@ -375,8 +373,7 @@ else if (FormEncodingType.MULTIPART == webRequest.getEncodingType()) { |
375 | 373 | // this is the case for GET as well as TRACE, DELETE, OPTIONS and HEAD |
376 | 374 | if (!webRequest.getRequestParameters().isEmpty()) { |
377 | 375 | final List<NameValuePair> pairs = webRequest.getRequestParameters(); |
378 | | - final String query = URLEncodedUtils.format( |
379 | | - HttpClientConverter.nameValuePairsToHttpClient(pairs), charset); |
| 376 | + final String query = HttpUtils.toQueryFormFields(pairs, charset); |
380 | 377 | uri = UrlUtils.toURI(url, query); |
381 | 378 | httpMethod.setURI(uri); |
382 | 379 | } |
|
0 commit comments