Anomaly with http get command

I’ve come across a strange anomaly.
The following url (//upload.wikimedia.org/wikipedia/commons/thumb/a/a3/PeterWeirApr2011.jpg/200px-PeterWeirApr2011.jpg) entered in a browser returns an image.
However the command HTTP GET (“https://upload.wikimedia.org/wikipedia/commons/thumb/a/a3/PeterWeirApr2011.jpg/”;$picture) returns an error (Argument types are incompatible). I’ve tried with dozens of different images hosted on the same wikipedia servers, but only this one fails to download.
Any idea as to what the problem might be?
Thank you in advance for your help.

when you pass TEXT, PICTURE or OBJECT to HTTP Get,
in other words, anything other than BLOB,
4D looks at the Content-Type header and deducts how to convert the response.

in your example,
the server is not return image/whatever but application/x-www-form-urlencoded
so 4D thinks it must be TEXT.

to be safe,
you need to use BLOB and do the conversion yourself.

ARRAY TEXT($hn;0)
ARRAY TEXT($hv;0)
C_BLOB($data)
$status:=HTTP Get(“http://upload.wikimedia.org/wikipedia/commons/thumb/a/a3/PeterWeirApr2011.jpg/200px-PeterWeirApr2011.jpg”;$data;$hn;$hv)
C_PICTURE($picture)
BLOB TO PICTURE($data;$picture)
SET PICTURE TO PASTEBOARD($picture)

Got it. Thanks a lot Miyako, you’ve made my day twice in a row!