Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

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

Solved Go to solution
Highlighted

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

New Contributor

 

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

Accepted Solutions

Re: invoke http

Master Collaborator

@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

 

 


 


If this answer resolves your issue or allows you to move forward, please choose to ACCEPT this solution and close this topic. If you have further dialogue on this topic please comment here or feel free to private message me. If you have new questions related to your Use Case please create separate topic and feel free to tag me in your post.  


 


Thanks,



Steven

View solution in original post

1 REPLY 1

Re: invoke http

Master Collaborator

@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

 

 


 


If this answer resolves your issue or allows you to move forward, please choose to ACCEPT this solution and close this topic. If you have further dialogue on this topic please comment here or feel free to private message me. If you have new questions related to your Use Case please create separate topic and feel free to tag me in your post.  


 


Thanks,



Steven

View solution in original post

Don't have an account?
Coming from Hortonworks? Activate your account here