Hi Sean, On 10 May 2012, at 16:56, Sean P. DeNigris wrote:
Why does one of the following work, and the other not?
fileUrl := 'https://ci.lille.inria.fr/pharo/view/Pharo%201.4/job/Pharo%201.4/lastSuccess...' asUrl.
"This succeeds in downloading the file" c := ZnClient new. c head: fileUrl; yourself. c url: fileUrl; downloadTo: targetPath; yourself.
"This fails with a HTTP 400" c := ZnClient new. c url: fileUrl. c head; yourself. c resetRequestIfNeeded; "fails with or without this line" downloadTo: targetPath; yourself.
I understand the problem, but this is really internal stuff of ZnClient. Yes, you can reuse a ZnClient instance to do multiple requests, but in second example, you do not re-specify the second request completely. There is no provision to do that. I will think about it. But #resetRequestIfNeeded is private API. And the state management is tricky right now. My question to you is, what are you trying to accomplish ? Check the size first, before doing a download maybe ? Sven -- Sven Van Caekenberghe http://stfx.eu Smalltalk is the Red Pill