Network

The functions for network/internet operations are described here.

HTTP functions

Download( str url, str filename ) int

The Download function downloads the file from the specified URL and saves it with the specified filename. The function returns the size of the downloaded file.

str ftemp = TempDir() + `/readme.html`
int size = Download("https://github.com/gentee/gentee", ftemp)

HTTPGet( str url ) buf

The HTTPGet function sends a GET request to the specified URL and returns a response as a buf variable. The function can be used to download small files without saving them to disk.

HTTPPage( str url ) str

The HTTPPage function sends a GET request to the specified URL and returns a string response.