All Functions Modules Pages
http

Functions

BOOLEAN http.getfile (STRING url, STRING path)
 Download the specified file. More...
 
NIL http.getfile (STRING url, STRING path, NUMBER over)
 Download the specified file (in thread mode). More...
 
BOOLEAN http.postfile (STRING url, STRING path, STRING data_out)
 Send data file indicated a Web address and then download the server response. More...
 
BOOLEAN http.postfile (STRING url, STRING path, STRING data_out, NUMBER data_len)
 Send data file indicated a Web address and then download the server response. More...
 

Detailed Description

Functions related to Hypertext Transfer Protocol. All actions performed by these functions include an automatic integrated manager cookies.

Function Documentation

BOOLEAN http.getfile ( STRING  url,
STRING  path 
)

Download the specified file.

Parameters
urlThe address of the file to download.
pathThe path where the file is saved (you must include the file name).
Returns
true if the file was downloaded successfully, false otherwise.
Note
This function can use the onNetGetFile() callback, more info here .
NIL http.getfile ( STRING  url,
STRING  path,
NUMBER  over 
)

Download the specified file (in thread mode).

Parameters
urlThe address of the file to download.
pathThe path where the file is saved (you must include the file name).
overThe numerical value: 1, to enter in thread mode. This is a list of all of the available constants and their values:
  • __NET_THREAD_STATE
    • Status of the download.
    • 0: No download or is starting.
    • 1: Download completed successfully.
    • 2: Download in progress.
    • -1: Occurred an error in the download.
  • __NET_THREAD_SIZE
    • The number of bytes to receive the download.
  • __NET_THREAD_WRITTEN
    • The number of bytes written from the discharge.
  • __NET_THREAD_VELOCITY
    • The download speed Kb/s.
Note
This function does not stop the script, or affects the performance, runs independently, for greater use, refer to the examples Examples of use of OneLua.
Returns
Nothing.
BOOLEAN http.postfile ( STRING  url,
STRING  path,
STRING  data_out 
)

Send data file indicated a Web address and then download the server response.

Parameters
urlThe Web address file receiver.
pathThe path where the file is saved (you must include the file name).
data_outThe information that will be sent to the Web server.
Returns
true if the file was downloaded successfully, false otherwise.
Note
This function can use the onNetGetFile() callback, more info here .
BOOLEAN http.postfile ( STRING  url,
STRING  path,
STRING  data_out,
NUMBER  data_len 
)

Send data file indicated a Web address and then download the server response.

Parameters
urlThe Web address file receiver.
pathThe path where the file is saved (you must include the file name).
data_outThe information that will be sent to the Web server.
data_lenThe size of the information that will be sent to the Web server.
Returns
true if the file was downloaded successfully, false otherwise.
Note
This function can use the onNetGetFile() callback, more info here .