hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bas Schulte <basschu...@gmail.com>
Subject How to encode GET parameter to iso-8859-1?
Date Mon, 09 Jun 2008 16:51:51 GMT

I need to encode my parameters in a GET request to a given host in  
iso-8859-1. How would I go about that with httpclient (3.1)?

There's EncodingUtil.getBytes that gives me a byte[]:

String messageData = "blah";

byte[] bytes = EncodingUtil.getBytes(messageData, "iso-8859-1");

How do I feed that byte[] properly to create a NameValuePair that I  
can feed to setQueryString, like so:

get.setQueryString(new NameValuePair[]{new NameValuePair("data", ???),

Any pointers how to solve this (may not even be specific to  
httpclient, just never stumbled upon this in java)?



To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org

View raw message