hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "micky" <micky_...@cyberpowersystems.com.tw>
Subject RE: [help] how to set an OutputStream to a POST request?
Date Thu, 28 Feb 2008 09:03:28 GMT
>>_But I still can't find there is a method or any way to replace
>>_HttpURLConnection.getOutputStream() function.

> You don't get an output stream, you specify
> and HttpEntity to be sent. If you have a String,
> use the StringEntity.

I retry the examples, and I finally can set a string with a name into NameValuePair[], then
put it into HttpEntity (by HttpPost.setEntity().)

The server can use request.getParameter() with a name to get the string.

Then I continue trying different HttpEntity.

Otherwise, when I use StringEntity or ByteArrayEntity to wrap the string and put it into HttpEntity
(by HttpPost.setEntity()), the server can't get the string use request.getReader() nor request.getInputStream().

But I can see the "postData" of request object (HttpServletRequest) in the debug and watch
mode in server-side.

I don't know how to retrieve the string from that postData attribute of HttpServletRequest!?

Is there any magic thing made I confused?

Thanks for any reply or suggestion.


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

View raw message