Legacy/fetchRemote: Difference between revisions
Jump to navigation
Jump to search
Fernando187 (talk | contribs) No edit summary |
Fernando187 (talk | contribs) No edit summary |
||
Line 11: | Line 11: | ||
{{Note|This page only contains legacy implementations. For current implementation check [[fetchRemote]]}} | {{Note|This page only contains legacy implementations. For current implementation check [[fetchRemote]]}} | ||
{{New items|5.0154|1.5.4-9.11342| | {{New items|5.0154|1.5.4-9.11342| | ||
Line 42: | Line 16: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool fetchRemote ( string URL[, table options ], callback callbackFunction[, table callbackArguments ] ) | bool fetchRemote ( string URL[, table options ], callback callbackFunction[, table callbackArguments ] ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== | ||
Line 78: | Line 52: | ||
==Example== | ==Example== | ||
{{New items|5.0154|1.5.4-9.11413| | {{New items|5.0154|1.5.4-9.11413| | ||
Example sending email via a web service (adopted from examples on https://documentation.mailgun.com/en/latest/user_manual.html) | Example sending email via a web service (adopted from examples on https://documentation.mailgun.com/en/latest/user_manual.html) |
Revision as of 17:43, 7 November 2024
This function allows you to post and receive data from HTTP servers. The calls are asynchronous so you do not get an immediate result from the call, instead a callback function you specify is called when the download completes.
In the case when the call fails, a string containing "ERROR" followed by an integer containing the error reason will be passed to the callback function. The reason for failure will be similar to errors found with websites - file not found, server not found and timeouts.
If you are using fetchRemote to connect to a PHP script, you can use file_get_contents('php://input') to read the postData sent from this function.
Returns
Example
Changelog
Version | Description |
---|
1.3.1-9.04605 | Added connectionAttempts argument |
1.3.2 | Added client side |
1.5.3-9.11270 | Added queueName argument |
1.5.4-9.11342 | Added alternative syntax |
1.5.4-9.11413 | Added formFields |
See Also
- abortRemoteRequest
- call
- fetchRemote
- getResourceConfig
- getResourceDynamicElementRoot
- getResourceExportedFunctions
- getResourceFromName
- getResourceName
- getResourceRootElement
- getResourceState
- getThisResource
- getRemoteRequests
- getRemoteRequestInfo