Created on 02-18-2022 12:34 AM - last edited on 02-18-2022 07:40 AM by ask_bill_brooks
I'm currently new with Nifi but I have a task to achieve. My task is to insert a data in a Database via InvokeHTTP Processor. But I don't know where can I insert the json format, I tried to insert it inside the Put Response Body In Attribute field and Changed the Send Message Body to "true".
But when I tried to start it, It doesn't proceed to the queue or even sends an error.
Created 02-20-2022 08:55 PM
Hi @georg ,
If you want to send content in the body of a POST or PUT call using InvokeHTTP, you typically create a flowfile with the content that you want to send and feed that to the InvokeHTTP processor, setting its "Send Message Body" attribute to "true" (default).
The InvokeHTTP will sent the content of the incoming flowfile as the body of the HTTP request.
Cheers,
André
Created 02-21-2022 12:28 AM
Hi @araujo Can you give me an example on how to post/put data using request body? or an example on creating a flowfile to send to the Invoke HTTP processor
Created 02-21-2022 03:59 PM
Hi, @georg ,
You can, for example, use the GenerateFlowFile processor to create a new flowfile from scratch with the content that you need to send. If you already have a flowfile that you are in the middle of processing, you could, for example, use ReplaceText to modify the content of that flowfile so that it conforms with what your PUT request needs to send.
Regards,
André
Created 02-23-2022 02:46 PM
Did the above answer your question?
Cheers,
André