HttpFileGet

Family: HTTP · 2 forms

What it does

HttpFileGet reads File on a HTTP object. It takes connectionID (an integer), serverFile (a string) and localFile (a string), and answers an integer. That is the first of 2 forms. connectionID is the id of a Connection object, obtained elsewhere in the HTTP family.

Syntax

1
HttpFileGet(connectionID integer, serverFile string, localFile string) → integer
2
HttpFileGet(connectionID integer, serverFile string, localFile string, postData string) → integer

Parameters

NameTypeIn forms
connectionIDintegerall
serverFilestringall
localFilestringall
postDatastring2

Every form returns

integer

Example · generated

Form 1, the short one

connection = CreateHttpConnection()DO  Print(HttpFileGet(connection, "assets/data.dat", "assets/data.dat"))  Sync()LOOP

Form 2, with every argument

connection = CreateHttpConnection()DO  Print(HttpFileGet(connection, "assets/data.dat", "assets/data.dat", "value"))  Sync()LOOP

CreateHttpConnection is there to give the call something to act on; HttpFileGet is the line that matters. The DO … LOOP is not decoration: a classic BASIC program ends the moment it runs out of lines, and Sync() is what draws the frame.

21 commands in HTTP