Example

This example Application demonstrates how to read weather data from an API using the HTTP Connector.

You can download the files here to try it out for yourself.

Refer to configuration to understand all configuration options of this Connector.

Step 1: Add the Connection

From the Properties blade of the widget to which the HTTP Connector will be linked, a data grid in our example, select the Data Source tab.

Click the plus icon next to Data Source and then the plus icon next to Connection.

Select the HTTP Connector and enter a name for the connection. In this case, set the name to "GetWeatherInfo".

Step 2: Configure Server Details

Enter the API URL. In this case, https://api.openweathermap.org/data/2.5/weather.

Step 3: Configure Input Mapping

Add input parameters along with their respective values and data types.

Step 4: Configure Output Mapping

Add output variables along with their respective data types.

Click Save.

Step 5: Use the Connection

Use the Connection that was just created to complete entering the new Data Source. In this case, set the name to "Weather Info", the connection to "GetWeatherInfo", and entity to "Return Data".

Save the Data Source.

Step 6: Use the Data Source

Select the Data Source we just added, and save the Application.

Click the Launch button and view the data grid.

Step 7: Results

Observe that weather data is returned from the Weather API.

Files

See the Import, Export, and Clone - XMPro article for steps to import a Data Stream.

Last updated