Xojo.Net.HTTPSocket : file download example?

Can anyone point me to a code example for a file download, using the new framework (Xojo.Net.HTTPSocket) ?

I have it working with the classic framework (and with curlsMBS), but I’m testing with the new one now, and the documentation (http://developer.xojo.com/xojo-net-httpsocket) is lacking examples.

Never mind, I got it:

Dim outputFile As Xojo.IO.FolderItem = Xojo.IO.SpecialFolder.Documents.Child("my.png") myHTTPSocket.Send("GET", "https://example.com/wp/wp-content/uploads/2017/09/example.png", outputFile)

Any other way to get a file if you don’t know the file url ?

in my case call an API and if all the data passed is correct I receive a file called [quote]document.pdf[/quote] which I would like to rename it and save it to a specific location, any details about that ?

I tried over the Xojo.Net.HTTPSocket and unfortunately I get some errors that I cannot replicate or debug.

I tried all the ways but unfortunately no way of getting that file and saving it on the disk.

If I use the PageReceived method I get the file in Content and if I see the content of the MemoryBlock I see the pdf file as text but unfortunately i have no idea how to trigger the File Received and start to process the file from there .

In the docs I have [quote]Called when a download of a file is completed as a result of calling Send and passing a FolderItem.[/quote]

So not to many details about this part.

Any details would be welcomed .

Thanks.