如何更改tRestClient的查询参数值

问题描述

我是新来的人才。我从最近两天开始致力于此工作,但无法完成。我想将api数据消费到我的数据库中。我有这个api =>
@H_404_2@http://api.dss.adapt-odisha.com/aagro?url=https://mausam.imd.gov.in/api/Nowcast_district_api.PHP

可提供所有地区的数据。我可以使用所有区域数据,但我的要求是,我想加载少数区域的数据,并且我的url仅支持一个区域ID作为查询参数,例如this =>

@H_404_2@ http://api.dss.adapt-odisha.com/aagro?url=https://mausam.imd.gov.in/api/Nowcast_district_api.PHP?id=204

并且这样

@H_404_2@http://api.dss.adapt-odisha.com/aagro?url=https://mausam.imd.gov.in/api/Nowcast_district_api.PHP?id=215

这些url仅显示我在查询参数中传递的那个地区的数据。我能够使用所有地区数据,但是我只想存储这些地区的数据。我该如何实现?
直到现在我都尝试过:

enter image description here

解决方法

您快到了!您需要做的是构建您想要获取的区域的列表(在这里,我放置了一个具有固定值的tFixedFlow,但是您可以拥有一个文件,一个数据库查询等)。

enter image description here

将此传递给tFlowToIterate,这将允许您遍历区域列表:列表中的每个区域都会有一个API调用。 配置2d tFixedFlow以从tFlowToIterate检索当前区域: enter image description here 像这样修改tRestClientUrl:

"http://api.dss.adapt-odisha.com/aagro?url=https://mausam.imd.gov.in/api/nowcast_district_api.php?id="+row2.district