Jump to content

Component: HTTP Fetch ( Comms): Difference between revisions

From Flowcode Help
No edit summary
m Text replacement - "class="wikitable" style="width:60%; background-color:#FFFFFF;"" to "class="mtx-class-macrotable wikitable""
Line 94: Line 94:


===Fetch===
===Fetch===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Line 113: Line 113:


===SetDataType===
===SetDataType===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Line 132: Line 132:


===SetMacro===
===SetMacro===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Line 151: Line 151:


===SetURL===
===SetURL===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Line 171: Line 171:
==Property reference==
==Property reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]

Revision as of 14:15, 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.

Fetch HTTP Example


The HTML source is hosted at the following URL: http://www.flowcode.co.uk/example/fetchtest.txt

File: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.

Fetch HTTP JSON Example


The HTML source is hosted at the following URL: http://www.flowcode.co.uk/example/jsonfetchtest.txt

File: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.

Fetch HTTP Time Date Example


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.

File:jsonfetchtimedate.txt


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.

Fetch Parameter Example


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.

File:get_data.txt


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.

Web Weather Example


Macro reference

Fetch

Fetch
Start the process of fetching a resource from a web server 
- STRING sParams
Parameters for the Fetch call 
- VOID Return


SetDataType

SetDataType
Override the DataType property 
- LONG Type
0=JSON Encoded. 1=Raw Text 
- VOID Return


SetMacro

SetMacro
 
- STRING sMacro
 
- VOID Return


SetURL

SetURL
Sets the URL for the Fetch call 
- STRING sURL
 
- VOID Return


Property reference

Properties
URL
 
Call macro
 
DataType
Decide what type of data to receive