[squeak-dev] Sockets, WebClient, HttpClient and friends
Tobias Pape
Das.Linux at gmx.de
Thu Mar 21 18:38:40 UTC 2019
> On 21.03.2019, at 13:14, H. Hirzel <hannes.hirzel at gmail.com> wrote:
>
> Hello
>
> This thread is related to my question how to get a picture from the web.
>
> I understand that I probably have to use WebClient.
>
> How would one of the convenience methods of WebClient be used to get a
> picture from the web?
maybe:
ImageReadWriter formFromStream: ((WebClient httpGet: 'the-url') contents readStream)
-t
>
> --Hannes
>
> On 1/18/19, tim Rowledge <tim at rowledge.org> wrote:
>>
>>
>>> On 2019-01-18, at 1:30 AM, Tobias Pape <Das.Linux at gmx.de> wrote:
>>>
>>> TL;DR: It's just WebClient with differing layers of icing on top.
>>
>> Hah; so it is. That's good, I guess. Evidently diving a dozen or so layers
>> down wasn't enough to discover that. ;-)
>>
>>>
>>> But, yes, it could all be a bit more clear cut.
>>
>> It certainly could; but more importantly it could do much better for raising
>> and handling errors helpfully. I note with wry amusement how the last part
>> of HTTPSocket class>>#httpGetDocument:args:accept:request: carefully takes
>> the helpful error info of WebClient and ensures that the less helpful
>> HttpSocket response is generated.
>>
>> And of course none of this alters the fact that a good few methods could do
>> with changing to handle network errors, whichever flavour of WebClient icing
>> they use!
>>
>>
>> tim
>> --
>> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
>> Useful random insult:- Proof that evolution CAN go in reverse.
>>
>>
>>
>>
>
More information about the Squeak-dev
mailing list
|