Component: HTTP Fetch ( Comms): Difference between revisions
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead"" |
|||
| (6 intermediate revisions by 3 users not shown) | |||
| Line 37: | Line 37: | ||
[[:File:fetchtest.txt]] | [[:File:fetchtest.txt]] | ||
| Line 49: | Line 50: | ||
[[:File:jsonfetchtest.txt]] | [[:File:jsonfetchtest.txt]] | ||
| Line 78: | Line 80: | ||
[[:File:get_data.txt]] | [[:File:get_data.txt]] | ||
===Weather Example=== | ===Weather Example=== | ||
| Line 84: | Line 88: | ||
{{Fcfile|Web_Weather.fcsx|Web Weather Example}} | {{Fcfile|Web_Weather.fcsx|Web Weather Example}} | ||
==Macro reference== | ==Macro reference== | ||
===Fetch=== | ===Fetch=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Fetch''' | ||
|- | |- | ||
| colspan="2" | Start the process of fetching a resource from a web server | | colspan="2" | Start the process of fetching a resource from a web server | ||
| Line 100: | Line 106: | ||
|- | |- | ||
| colspan="2" | Parameters for the Fetch call | | colspan="2" | Parameters for the Fetch call | ||
|- | |||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | |||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | |||
|} | |||
===SetDataType=== | |||
{| class="mtx-class-macrotable wikitable" | |||
|- | |||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | |||
| width="90%" class="mtx-class-macrohead" | '''SetDataType''' | |||
|- | |||
| colspan="2" | Override the DataType property | |||
|- | |||
|- | |||
| width="10%" align="center" | [[File:Fc9-s32-icon.png]] - LONG | |||
| width="90%" | Type | |||
|- | |||
| colspan="2" | 0=JSON Encoded. 1=Raw Text | |||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| Line 107: | Line 132: | ||
===SetMacro=== | ===SetMacro=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SetMacro''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
| Line 126: | Line 151: | ||
===SetURL=== | ===SetURL=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SetURL''' | ||
|- | |- | ||
| colspan="2" | Sets the URL for the Fetch call | | colspan="2" | Sets the URL for the Fetch call | ||
| Line 146: | Line 171: | ||
==Property reference== | ==Property reference== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Properties''' | ||
|- | |- | ||
|- | |- | ||
| Line 161: | Line 186: | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
|- | |||
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | |||
| width="90%" | DataType | |||
|- | |||
| colspan="2" | Decide what type of data to receive | |||
|} | |} | ||
Latest revision as of 14:23, 13 July 2026
| Author | MatrixTSL |
| Version | 0.1 |
| Category | Comms |
HTTP Fetch component
Component designed to request resources from an external HTTP server.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_WEBEXP_Fetch.fcsx
Please click here to view the component source code (Beta): FC_Comp_Source_WEBEXP_Fetch.fcsx
Detailed description
No detailed description exists yet for this component
Examples
HTTP
Example program showing how to retreive the HTML source of a HTTP URL.
The HTML source is hosted at the following URL: http://www.flowcode.co.uk/example/fetchtest.txt
HTTP JSON Encoded
Example program showing how to retreive the HTML source of a HTTP URL. Here the source is encoded JSON data which we can parse through.
The HTML source is hosted at the following URL: http://www.flowcode.co.uk/example/jsonfetchtest.txt
HTTP JSON Encoded Time and Date
Example program showing how to retreive the HTML source of a HTTP URL. Here the source is encoded JSON data which we can parse through. The data is created using a PHP script which allows for dynamic data such as the current time and date.
The HTML source is hosted at the following URL: http://www.flowcode.co.uk/example/jsonfetchtimedate.php
Please note the file type for the file below has been changed from .php to .txt to be allowed onto the Wiki.
Fetch Parameters
Example program showing how to retreive the JSON data source of a HTTP URL. Here the source is encoded JSON data which we can parse through. The data is created using a PHP script which allows for dynamic data in this case based on the selection made using the radio buttons.
The HTML source is hosted at the following URL: http://www.flowcode.co.uk/example/get_data.php
Please note the file type for the file below has been changed from .php to .txt to be allowed onto the Wiki.
Weather Example
Example program showcasing a number of components used together to collect data from a URL using fetch, before processing the data using the object helper and array helper components.
Macro reference
Fetch
| Fetch | |
| Start the process of fetching a resource from a web server | |
| sParams | |
| Parameters for the Fetch call | |
| Return | |
SetDataType
| SetDataType | |
| Override the DataType property | |
| Type | |
| 0=JSON Encoded. 1=Raw Text | |
| Return | |
SetMacro
| SetMacro | |
| sMacro | |
| Return | |
SetURL
| SetURL | |
| Sets the URL for the Fetch call | |
| sURL | |
| Return | |
Property reference
| Properties | |
| URL | |
| Call macro | |
| DataType | |
| Decide what type of data to receive | |