Difference between revisions of "UrlLoader:load"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
'''Available since:''' Gideros 2012.2.2<br/>
 
'''Available since:''' Gideros 2012.2.2<br/>
 +
'''Class:''' [[UrlLoader]]<br/>
 +
 
=== Description ===
 
=== Description ===
<br />
+
Loads data from the specified URL. If there is any load operation in progress, it is terminated and new progress starts.
Loads data from the specified URL. If there is any load operation in progress, it is terminated and new progress starts.<br />
+
<syntaxhighlight lang="lua">
Please refer to [[UrlLoader.new]] for more detailed description of `url`, `method` and `body` parameters.<br />
+
UrlLoader:load(url,method,headers,body)
<br />
 
<source lang="lua">
 
UrlLoader:load(url,method,headers,body)
 
 
</source>
 
</source>
 +
 +
Please refer to [[UrlLoader.new]] for more detailed description of ''url'', ''method'' and ''body'' parameters.
 +
 
=== Parameters ===
 
=== Parameters ===
'''url''': (string, optional) URL to download. This parameter is optional and if specified loading starts immediately. <br/>
+
'''url''': (string, optional) URL to download. This parameter is optional and if specified loading starts immediately<br/>
'''method''': (string, default = &quot;get&quot;) HTTP request method. <br/>
+
'''method''': (string, default = "get") HTTP request method
'''headers''': (table, optional) HTTP headers. <br/>
+
'''headers''': (table, optional) HTTP headers
'''body''': (string, optional) HTTP body data. This data is sent as the message body of a request. <br/>
+
'''body''': (string, optional) HTTP body data. This data is sent as the message body of a request
 +
 
 +
{{UrlLoader}}

Latest revision as of 14:32, 13 July 2023

Available since: Gideros 2012.2.2
Class: UrlLoader

Description

Loads data from the specified URL. If there is any load operation in progress, it is terminated and new progress starts. <syntaxhighlight lang="lua"> UrlLoader:load(url,method,headers,body) </source>

Please refer to UrlLoader.new for more detailed description of url, method and body parameters.

Parameters

url: (string, optional) URL to download. This parameter is optional and if specified loading starts immediately
method: (string, default = "get") HTTP request method headers: (table, optional) HTTP headers body: (string, optional) HTTP body data. This data is sent as the message body of a request