What about ...

Form fromBinaryStream: (WebClient httpGet: 'https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Squeak-x11.png/617px-Squeak-x11.png') contentStream.

... I think we should add a #fromUrl: besides Form class >> #fromFileNamed: and there distinguish between file paths and HTTP urls etc:

Form fromUrl: 'https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Squeak-x11.png/617px-Squeak-x11.png'.


Am 21.03.2019 11:51:58 schrieb H. Hirzel <hannes.hirzel@gmail.com>:


What is a good modern way in Squeak to load a picture from the web?

I am looking for an equivalent of

| pngPicURL aStream |

pngPicURL := 'https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Squeak-x11.png/617px-Squeak-x11.png'.

aStream := HTTPSocket httpGet: pngPicURL.

(ImageReadWriter formFromStream: aStream) asMorph openInHand

And answer or just comments are welcome.

Thank you.

Kind regards