hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Subhash Chandran <sub...@gmail.com>
Subject Http Multi-part exception when using InputStreamBody
Date Tue, 24 Mar 2009 03:21:58 GMT
We are getting this Exception:

<quote>
Exception in thread "main" org.apache.http.client.ClientProtocolException
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:557)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
	at it.sella.iq.Main.main(Main.java:63)
Caused by: org.apache.http.client.NonRepeatableRequestException:
Cannot retry request with a non-repeatable request entity
	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:402)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
	... 3 more
</quote>

when we are trying to send Multi-part messages like this:

<quote>
File f = ...;
DefaultHttpClient httpclient = new DefaultHttpClient();

MultipartEntity entity = new MultipartEntity();

entity.addPart("file", new InputStreamBody(new FileInputStream(f),
f.getName()));
</quote>

We tried adding:

<quote>
httpclient.setHttpRequestRetryHandler(new
DefaultHttpRequestRetryHandler(0, false));
</quote>

This also does not help. How do we fix this?

Additional Info: when we are using FileBody instead of
InputStreamBody, the code is working fine.

-- 
Regards,
Subhash Chandran S

http://indiwiz.com/
http://code.google.com/p/rest-client/

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