Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

How to send json body to Apache NiFi InvokeHTTP

avatar
New Contributor

I have an InvokeHTTP processor Apache NiFi, I need to send a curl request with this content

curl https://reqbin.com/echo/post/json
-X POST
-H 'Content-Type: application/json'
-d '{
	"login": "my_login",
	"password":"my_password"
}'

I can't figure out what to do -d

1 REPLY 1

avatar
Super Guru

Hi,

 

The request Body has to be provided as flowfile to the InvokeHttp Processor per the processor description:

 

SAMSAL_0-1685111037806.png

 

You can use an upstream processor to the InvokeHttp like ReplaceText processor to generate the request body a follows:

 

SAMSAL_1-1685111384642.png

 

To send incoming flowfile content as Request Body , make sure the following property of the invokehttp processor is set to true (default):

 

SAMSAL_2-1685111771806.png

 

To make sure you are always getting a response no matter if its successful or not make sure to set the following invokehttp processor to true (default false):

 

SAMSAL_3-1685111869728.png

 

If that helps please accept solution.

Thanks