Name of attribute for “Put Response Body In Attribute” in invokeHTTP

邮差的信 提交于 2019-12-09 03:58:27

问题


I have a endpoint would return response as follow.

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

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

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

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


回答1:


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

Documentation for Put Response Body In Attribute:

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.

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.



来源:https://stackoverflow.com/questions/57760560/name-of-attribute-for-put-response-body-in-attribute-in-invokehttp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!