Funny enough, entity enclosing methods buffer content per default. You must have 
configured your PostMethod to NOT buffer content. 

Basically all it takes it passing CONTENT_LENGTH_AUTO as a parameter to 
PostMethod#setRequestContentLength

mypost.setRequestContentLength(CONTENT_LENGTH_AUTO);

For more details see

http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/methods/EntityEnclosingMethod.html

I hope this helps

Oleg

-----Original Message-----
From: George Gastaldi [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 15:37
To: Commons HttpClient Project
Subject: RE: URIException - Unbuffered entity enclosing request can not
be repeated


Thanks for the quick answer.

Bonus question: How do I let PostMethod class to buffer ? ;)


-----Original Message-----
From: Kalnichevski, Oleg [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 10:27 AM
To: Commons HttpClient Project
Subject: RE: URIException - Unbuffered entity enclosing request can not
be repeated


George,

What it basically means is that an entity enclosing request (such as POST or
PUT) cannot be retried because the request content has not been buffered.
Entity enclosing request may need to be retired in case of authentication
challenge or i/o failure.

In order to work this problem around you may need 

1.) provide a retry mechanist of your own (a simple while not done loop) in
case it is an i/o problem
2.) use preemptive authentication (provided you are using Basic scheme) in
case it is an authentication problem
3.) just let the PostMethod class to buffer the damn thing

I hope this helps

Oleg

-----Original Message-----
From: George Gastaldi [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 15:16
To: Commons HttpClient Project (E-mail)
Subject: URIException - Unbuffered entity enclosing request can not be
repeated


Dear List,

I am using HTTPClient beta 1 and, strangely, the following exception
(URIException) occurred:        
        "Unbuffered entity enclosing request can not be repeated. Code: 0"
followed by a 501 - Not implemented code.       What situations could this
occur (in a less technical way) ? This error message is quite confusing.

Thanks !

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

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

Reply via email to