commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Becke <be...@u.washington.edu>
Subject Re: [HttpClient] Can't even Post Data
Date Wed, 30 Jun 2004 03:48:00 GMT
Hi Andrew,

> The next problem to solve:
> When I inherited the applet, it's communication protocol consisted of
> breaking down java objects into a stream using a custom protocol to
> separate fields, objects etc. This is transmitted over the wire and
> reconstructed at the other end. I am part way through converting that 
> to
> use java's ability to stream objects itself so that I can just 
> construct
> objects and let java stream them. It's not entirely clear to me how to 
> go
> about using HttpClient to stream java objects as opposed to text/html.

HttpClient 2.0 does not have a good way to stream data.  The only real 
option would be to buffer the ObjectOutputStream to disk or byte[] and 
then use this as the method's request body.

In HttpClient 3.0 (currently at alpha1) there is a better option, 
setRequestEntity().  You would want to implement a custom RequestEntity 
that writes the object stream inside of 
RequestEntity.writeRequest(OutputStream).

If you do end up using 3.0 please let us know how things go.  This is 
new functionality and any feedback is quite welcome.

Thanks,

Mike


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


Mime
View raw message