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(),
   request.getContentLength(),
   request.getContentType()));
}

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.
http://www.microsoft.com/middleeast/windows/windowslive/products/photos-share.aspx?tab=1
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message