invokeHTTP中“将响应主体放入属性"的属性名称 [英] Name of attribute for “Put Response Body In Attribute” in invokeHTTP

查看:96
本文介绍了invokeHTTP中“将响应主体放入属性"的属性名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个端点将按如下方式返回响应.

I have a endpoint would return response as follow.

{
   "result": [
   {},
   ....
   {}]
}

我正在尝试使用invokeHTTP并启用在属性中放入响应正文"以保留来自api的原始流文件和响应.

I am trying to use invokeHTTP and enable "Put Response Body In Attribute" to keep origin flowfile and response from api.

但似乎添加了一个名为$ .result的属性,如下所示:

but it seems add a attribute named $.result as follow

是否可以为result属性设置一个适当的名称?谢谢.

Is there any way to set a proper name for result attribute ? Thanks.

推荐答案

您尝试使用JSON路径提取结果.但是,这在InvokeHttp中是不可能的.您可能要使用

You try to extract results using a JSON path. However this is not possible from within InvokeHttp. You may want to use EvaluateJsonPath processor.

如果设置,则将收到的响应正文放入一个属性中 原始FlowFile,而不是单独的FlowFile.属性 通过评估此属性的值来确定要输入的键.

If set, the response body received back will be put into an attribute of the original FlowFile instead of a separate FlowFile. The attribute key to put to is determined by evaluating value of this property.

要在调用InvokeHttp之后保留原始流文件,可以在调用InvokeHttp之前将其移动到属性(如果内容足够小),或者可以将MergeContent与原始流文件和来自InvokeHttp的响应流文件一起使用.

To keep the original flow file after calling InvokeHttp, you can move it to an attribute (if the content is small enough) just before calling InvokeHttp or you can use MergeContent with original flow file and response flow file from InvokeHttp.

这篇关于invokeHTTP中“将响应主体放入属性"的属性名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆