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!

invoke http. i want to make form Authorisation before data send to api,i have been given a post http link (other than host url), content type and username and password , where and how to add them in nifi in invoke http

avatar
Explorer

 

i have got the below details other than normal host url,

POST /j_security_check
Content-type: application/x-www-form-urlencoded

j_username=<userid>&j_password=<password>

 

1 ACCEPTED SOLUTION

avatar
Super Guru

@san_re The configuration of Remote Url in InvokeHTTP should be as follows:

 

/j_security_check?j_username=${j_username}&j_password=${j_password}

Notice the credential values are passed to the url with the ?.  This is the only change in the processor config.

 

Here is a demo flow:

Screen Shot 2020-04-28 at 8.02.58 AM.png

GenerateFlowFile - starts flow for testing

UpdateAttribute - sets user, pass,and mime type attributes needed in InvokeHttp

InvokeHttp - sends POST

 

You can find this template on my GitHub to inspect the entire flow:

https://github.com/steven-dfheinz/NiFi-Templates/blob/master/InvokeHttp_Demo.xml

 

View solution in original post

1 REPLY 1

avatar
Super Guru

@san_re The configuration of Remote Url in InvokeHTTP should be as follows:

 

/j_security_check?j_username=${j_username}&j_password=${j_password}

Notice the credential values are passed to the url with the ?.  This is the only change in the processor config.

 

Here is a demo flow:

Screen Shot 2020-04-28 at 8.02.58 AM.png

GenerateFlowFile - starts flow for testing

UpdateAttribute - sets user, pass,and mime type attributes needed in InvokeHttp

InvokeHttp - sends POST

 

You can find this template on my GitHub to inspect the entire flow:

https://github.com/steven-dfheinz/NiFi-Templates/blob/master/InvokeHttp_Demo.xml