[prev in list] [next in list] [prev in thread] [next in thread] 

List:       httpclient-users
Subject:    RE: [help] how to set an OutputStream to a POST request?
From:       "micky" <micky_lee () cyberpowersystems ! com ! tw>
Date:       2008-02-28 9:03:28
Message-ID: 000201c879e8$c8bcd050$5a3670f0$ () com ! tw
[Download RAW message or body]

Hi,
 
> > _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.


Sincerely,
Micky


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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic