如何在talend中将JSON发送到RestAPI?

问题描述 投票:0回答:1

大家好,

我是Talend的新手,只是学习如何使用这些组件。

这是用例csv->映射-> json-> rest api

对于组件,我像这样实现

tFileInputDelimited-> tMap-> tFileOutputJson-> RestClient

输出文件符合我的预期。

现在如何根据请求将文件中的json内容发送到rest api?enter image description hereenter image description here

json rest csv talend
1个回答
0
投票

[如果不需要json文件,则可以使用tWriteJSONFields代替tFileOutputJSON,这是一项额外的好处,使您可以更好地控制json树。然后,您可以这样做:

tFileInputDelimited -- tMap -- tWriteJSONFields -- tMap -- tRESTClient

tWriteJSONFields中,定义一个将保留json的列,然后在tMap中,将其映射到您从tRESTClient继承的“字符串”列(它的架构中有2个预定义的列,主体和字符串),则您的tMap输出上需要具有与tRESTClient的输入模式相同的模式。

© www.soinside.com 2019 - 2024. All rights reserved.