hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gerardo Corro <rob_gar_...@hotmail.com>
Subject postMethod.setRequestEntity encoding issues
Date Sat, 18 Jul 2009 23:00:30 GMT

Hi HC people,

I'm implementing a filter that processes POST requests, these requests have query parameters
that were encoded with UTF-8, if I try something like:

if (httpRequest.getMethod().equals("POST")) {
   ((PostMethod) httpMethod).setRequestEntity(new InputStreamRequestEntity(request.getInputStream(),

The query parameters are not received correctly on the other side, however if I change the
'method' of the form to 'get' and then I do something like:

httpMethod.setURI(new URI(resourcePath.toString(), true, "UTF--8"));

then everything works properly, so the problem is that if the request comes as a 'POST' its
encoding is not being processed properly.

Please assist. Thanks!

Share your memories online with anyone you want.
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message