Private Sub Button1_Click
Wait For (Download("https://example-files.online-convert.com/document/txt/example.txt")) Complete (Success As Boolean)
If Success Then
Label1.Text = sample
File.WriteString(File.DirInternal, "sample.txt", sample)
Label2.Text = "File size = " & File.Size(File.DirInternal, "sample.txt") & " bytes"
Else
Label2.Text = "Download failed."
End If
End Sub
Private Sub Download (url As String) As ResumableSub
Dim j As HttpJob
j.Initialize("", Me)
j.Download(url)
Wait For (j) JobDone (j As HttpJob)
sample = j.GetString
j.Release
Return j.Success
End Sub