If you’re using HTMLViewer, see this post:
Otherwise, URLConnection. There are examples in the Xojo IDE and documentation.