Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

how to send dictionary in invoke http processor

avatar
Contributor

hi everyone ,

We want to put data in web app using API endpoint 

https://localhost:8000/api/event/${id}/attributes this is the API endpoint that i have used in invoke HTTP processor in Remote URL field with PUT method. 

we want to create new attribute with value and this attribute is a dictionary type so we have to pass the data in the dictionary format for this we have used updateattribute processor and attributetojson processor. 

updateAttribute processor snap

renuu_0-1591268658480.png

Attributetojson processor snap

renuu_1-1591268717755.png

and the below is out of attributetoJson processor (flowfile)

{"note":"note from nifi","attributes":"{\n \"workflow\":\"process\"\n }","id":"1ecfbcbb-38bf-49e9-a77e-a88w"}

 

the error msg in invoke http processor 

{ "code": 500, "errors": [ "Traceback (most recent call last):\n File \"/usr/local/lib/python3.6/site-packages/flask/app.py\", line 1949, in full_dispatch_request\n rv = self.dispatch_request()\n File \"/usr/local/lib/python3.6/site-packages/
No value set
 
as per my knowledge this is type error. I think the Dictionary is not sending in correct format . i have also used ${attributes:unescapeJson()} in updateAttribute ...but i think i have made a mistake in the declaration
property_nameproperty_value
attributes{"workflow": "process"}
'attributes' ${attributes:unescapeJson()}
 
 thanks 

 

1 ACCEPTED SOLUTION

avatar
Super Guru
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login
1 REPLY 1

avatar
Super Guru
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login