本文介绍了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中是不可能的.您可能要使用 EvaluateJsonPath 处理器.

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

将响应主体放入属性的文档:

要在调用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中“将响应主体放入属性"的属性名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 04:20