hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Grant Ingersoll" <gsing...@syr.edu>
Subject POST and UTF-8
Date Tue, 06 Jul 2004 20:52:29 GMT
Hi,

Have searched the archives, but cannot find an answer on how to submit a POST that has form
parameters that need to be encoded in UTF-8.  I am setting the Content-Type request header,
but am unsure as how to set the request body.  Do I use a ByteArrayInputStream?  Does anyone
have an example of how to do this as far as putting FORM parameters into the IS?  Do I do
something like:

byte [] bytes = "myKey=myValue".getBytes("UTF-8");

ByteArrayInputStream is = new ByteArrayInputStream(bytes);
postMethod.setRequestBody(is);


---
I have 4 such parameters that need to be sent.  Any help is appreciated.

Thanks,
Grant


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org


Mime
View raw message