commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sanjeev Tripathi" <>
Subject RE: [httpclient] How to send and recieve Serialized Object usingHttpClient
Date Wed, 09 Feb 2005 16:54:18 GMT
Actually request parameter that I set in HttpCleint I can use in servlet
There is no way (or at least I don't know) to retrieve request
attribute/parameter in http client those set in servlet. This is very
simple in jsp but in http client I need to write object to
outputstream{ObjectOutputStream oos = new

To work this I need to set content type as follows


I don't want to set content type "application/octet-stream" that's our

Every thing is fine in client side.

Sanjeev Tripathi

-----Original Message-----
From: Wendy Smoak [] 
Sent: Wednesday, February 09, 2005 10:23 AM
To: Sanjeev Tripathi;
Subject: Re: [httpclient] How to send and recieve Serialized Object

From: "Sanjeev Tripathi" <>
> I am able to send object as string same way as you suggested from http
> client but from servlet I still need to use content type to
> "application/octet-stream" to receive object in httpclient side but I
> want to use content type "text/plain" in servlet.
> If I write object as byte on respose that object I am not able to
> It is giving "invalid header" error in http client side. But I will
> Matt's way and let you know.

If you post the code you're using, someone can probably help.  I'm quite
lost by now trying to remember who suggested what.

If you're getting all the way to the base64 encoded byte[], can't you
it into a String and then use that as the value of a request parameter
the POST?  Wasn't that the original goal, to serialize an object,
encode the binary data, and send it to the server as text?

If so, there's a String constructor that takes a byte[], (and you can
specify the charset if necessary).

Wendy Smoak

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message