Support Questions

Find answers, ask questions, and share your expertise

InvokeHTTP error.

avatar
Super Collaborator

Hi,

I am trying to use InvokeHTTP with the same info as below..(this is generated from a successful call from the vendors test page)...and getting sockettimeout error.

curl -X POST --header "Content-Type: application/x-www-form-urlencoded" --header "Accept: application/vnd.api+json" -d "grant_type=password&client_id=myclientid&client_secret=myclientsecret&username=Saikrishna.Tarapareddy@mycompany&password=mypassword" "https://api.socialcode.com/oauth2/token"

Here is how my invokeHttp process looks.i tried to match all inputs as dynamic properties.

thanks for your help..

8535-invoke1.png

8536-invoke2.png

1 ACCEPTED SOLUTION

avatar
Super Collaborator

it worked when i changed my ReplaceText to the format below. i think this has to do with the mime-type urlencoded.

remember we cannot send special chars like @

i had to send it as %40

This is how the ReplaceText processor looks..

8719-invoke2.png

grant_type=password&client_id=6e880286&client_secret=d12f0f6d41cfe81fcfc122e3fc17a833&username=Saikrishna.Tarapareddy%40purina.nestle.com&password=7heStuhuwa

also i had mime.type = application/x-www-form-urlencoded in my updateattribute processor.

8720-invoke1.png

Thanks you all.

View solution in original post

5 REPLIES 5

avatar

According to the curl man page, the "-d" denotes the data. So everything you have in the quotes after "-d" would have to be the content of the FlowFile (which gets posted as the body).

avatar
Super Collaborator

@jpercivall

Since there is a similar thread below , i posted a detailed flow there.

i tried to send it as content from a flowfile but still not working.

https://community.hortonworks.com/questions/54481/how-to-add-request-headers-and-request-body-to-the...

Regards,

Sai

avatar
Master Guru

avatar
Super Collaborator

@Timothy Spann,

My NiFi is not SSL configured yet , can I still create SSL Context even if my NiFi instance is not.??

avatar
Super Collaborator

it worked when i changed my ReplaceText to the format below. i think this has to do with the mime-type urlencoded.

remember we cannot send special chars like @

i had to send it as %40

This is how the ReplaceText processor looks..

8719-invoke2.png

grant_type=password&client_id=6e880286&client_secret=d12f0f6d41cfe81fcfc122e3fc17a833&username=Saikrishna.Tarapareddy%40purina.nestle.com&password=7heStuhuwa

also i had mime.type = application/x-www-form-urlencoded in my updateattribute processor.

8720-invoke1.png

Thanks you all.