Starting with CURL functions
To run the transfer, you call Perform method. If you run the transfer in a thread, you may want to look in the PerformMT function for better threading.
After the transfer completed and you have no error on the transfer, you can work on the result. For example you can use GetInfoHTTPConnectCode function to see what HTTP error code you got. There success has the value 200. So here is your example code:
dim c as new CURLSMBS
c.OptionURL = "http://www.monkeybreadsoftware.de/realbasic/images/MBSsmall.jpg"
c.CollectOutputData = true
dim e as integer = c.Perform
if e = 0 then
dim data as string = c.OutputData
dim pic as Picture = JPEGStringToPictureMBS(data)
Backdrop = pic
else
MsgBox "Error: "+str(e)
end if
c.OptionURL = "http://www.monkeybreadsoftware.de/realbasic/images/MBSsmall.jpg"
c.CollectOutputData = true
dim e as integer = c.Perform
if e = 0 then
dim data as string = c.OutputData
dim pic as Picture = JPEGStringToPictureMBS(data)
Backdrop = pic
else
MsgBox "Error: "+str(e)
end if
For help on debugging what's going on, you can set OptionVerbose to true to see debug messages. if you set CollectDebugData to true, you can find the debug messages in DebugData property:
c.OptionVerbose = True
c.CollectDebugData = true
dim d as string = c.DebugData
c.CollectDebugData = true
dim d as string = c.DebugData
Next you may need to add more options like OptionUserName/OptionPassword. Also you can set proxy or other authentications.
CURL is powerful and can do http requests, ftp/sftp/ftps up and downloads, send emails or send forms.