jira-importer opened a new issue, #1245:
URL: https://github.com/apache/httpcomponents-core/issues/1245

   **[phoebe 
chen](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=JIRAUSER283955)**
 opened 
**[HTTPCORE-734](https://issues.apache.org/jira/browse/HTTPCORE-734?redirect=false)**
 and commented
   
   We are doing upgrade from httpclient (4.5.13) to httpclient5 (5.2.1).
   
   And after the upgrade, we found when use following sample code to create a 
post request, the request execution will fail with 400 Bad Request error, 
because the character "~" in parameter string is not encoded into %7E. If we 
set the charset for UrlEncodedFormEntity to UTF-8, still hit same issue.
   
   ```java
   HttpPost request = new HttpPost(strUrl);
   List<NameValuePair> parameters = new ArrayList<NameValuePair>();
   parameters.add(new BasicNameValuePair("name", "a~b"));
   HttpEntity postParams = new UrlEncodedFormEntity(parameters);
   request.setEntity(postParams); 
   ```
   
    
   
   While the encoding was working correctly with httpclient (4.5.13).
   
   
   ---
   
   **Affects:** 5.2.1
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to