hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Sending serialized object and stream
Date Sun, 18 May 2008 15:09:08 GMT
On Fri, 2008-05-16 at 16:05 -0400, Natarajan_Valli@emc.com wrote:
> Hi All,
> 
> I've requirement to send both serialized java object and stream object.
> Here is the code that sends serialized object
> 
>             ByteArrayOutputStream requestStream = new
> ByteArrayOutputStream();
>             ObjectOutputStream objectOutput = new
> ObjectOutputStream(requestStream);
>             objectOutput.writeObject(request);
>             objectOutput.close();
> 
>             InputStream requestContent = new
> ByteArrayInputStream(requestStream.toByteArray());
>             if (requestContent != null) {
>                 post.setRequestEntity(new
> InputStreamRequestEntity(requestContent));
>             }
> 
> We need to optionally send stream object as well. I believe we need to
> use multipart request entity. The HC currently supports FilePart and
> StringPart. Do we need to write another type of Part like StreamPart to
> do so? 
> 

Yes, you do

Oleg

> Help is appreciated.
> 
> Thanks in advance
> 
> Valli
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 


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


Mime
View raw message