Hello Santo,

> Seems this is only possible since v3.0 of HttpClient, while I'm still 
using 2.0.

true

> PostMethod and PutMethod are available in v2.0 but I cannot find any 
other
> way than setRequestBody
> to post data to the server, meaning I have to use a NameValuePair array,

you can set the request body as an InputStream at least:
http://jakarta.apache.org/commons/httpclient/2.0/apidocs/org/apache/commons/httpclient/methods/EntityEnclosingMethod.html#setRequestBody(java.io.InputStream)

> meaning I cannot send my Hashtable (and other objects)
> without first converting it into a ByteArray,

true, but you'll have to convert to a binary representation anyway.

> which is what I'm doing right
> now and is giving the "invalid stream header".

You're getting a problem on re-conversion, and you're not sending
a byte array but some string stuff. That isn't necessary with 2.0 either.
 
> Probably the best thing I can do is upgrade to 3.0, but before I do that 
I
> want to know if it's backwards compatible with 2.0

probably best: yes. backwards compatible: not fully.

> or will it be very likely I have to modify large parts of my code ?

It is very likely you'll have to modify minor parts of your code.

cheers,
  Roland


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to