Code: (Select All)
$Unstable:Http
Screen _NewImage(800, 600, 32)
logo$ = "https://qb64phoenix.com/qb64wiki/resources/assets/peWikiLogo.png"
image$ = Download$(logo$, foo&)
imagehandle = _LoadImage(image$, 32, "memory")
_PutImage , imagehandle
' Content of the HTTP response is returned. The statusCode is also assigned.
Function Download$ (url As String, statusCode As Long)
h& = _OpenClient("HTTP:" + url)
statusCode = _StatusCode(h&)
While Not EOF(h&)
_Limit 60
Get #h&, , s$
content$ = content$ + s$
Wend
Close #h&
Download$ = content$
End Function
Note: This requires version 3.6 or above to run!