Reputation: 467
I am trying to post a json request to the handlehttp processor in Nifi. Could this be achieved as currently i am getting a 0 byte file passed to the flowfile. Is there any way we can pass the json request through the flowfile? Thanks
This the sample URL i am posting using python requests library. requests.post(localhost:6202/sample,json={"id":1,"name":"test"}
Upvotes: 0
Views: 3053
Reputation: 12083
Your flow is showing no flow files being transferred, rather than 0-byte flow files being transferred. Do you mean that you are getting a 404 response in your flow? If so, that is because you do not have a HandleHttpResponse in the flow to return a status code. I was able to get
requests.post("http://localhost:6202/sample",json={"id":1,"name":"test"})
to work with a HandleHttpRequest -> LogAttribute -> HandleHttpResponse flow.
Upvotes: 2