commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wendy Smoak <j...@wendysmoak.com>
Subject Re: [httpclient] How to send and recieve Serialized Object using HttpClient
Date Wed, 09 Feb 2005 16:22:30 GMT
From: "Sanjeev Tripathi" <sanjeev.tripathi@parago.com>
> 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 receive.
> It is giving "invalid header" error in http client side. But I will try
> 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 turn
it into a String and then use that as the value of a request parameter for
the POST?  Wasn't that the original goal, to serialize an object, base-64
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).

HTH,
-- 
Wendy Smoak


---------------------------------------------------------------------
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