Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

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