Ravi Kiran G
Ravi Kiran G

Reputation: 467

Handlehttp processor in nifi

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

enter image description here

This the sample URL i am posting using python requests library. requests.post(localhost:6202/sample,json={"id":1,"name":"test"}

enter image description here

Upvotes: 0

Views: 3053

Answers (1)

mattyb
mattyb

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

Related Questions