Support Questions

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

NIFI:Not able to POST using invokehttp, working perfect if used with generate file processor but does not works with gettwitter as a source (json)

avatar
New Contributor

Hi ,

I have created 2 flows -

1] in this flow i have used GenerateFlowFile->UpdateAttribute->InvokeHttp

GenerateFlowFile config- 

Dataformat = text

CustomText = Science is magic$$@@ i love Data ## 

UpdateAttribute config -

mime.type = application/x-www-form-urlencoded

InvokeHttp config - 

HTTP method = POST

SourabhStreamin_1-1617292918055.pngSourabhStreamin_2-1617294318773.pngSourabhStreamin_3-1617294579634.png

and this works super fine . 

But when i use this with gettwitter it fails as shown in below - 

 

SourabhStreamin_4-1617294875931.png

1] GetTwitter is working fine - 

2] EvaluateJsonPath - 

SourabhStreamin_5-1617294986532.png

3] AttributeTOJson- 

SourabhStreamin_6-1617295038851.png

4] UpdateAttribute- 

SourabhStreamin_7-1617295075097.png

5] ReplaceText - 

 

SourabhStreamin_9-1617295195521.png

 

6] InvokeHTTP - 

 

SourabhStreamin_10-1617295249939.png

 

SourabhStreamin_11-1617295279382.png

 

SourabhStreamin_12-1617295304156.png

 

this is the error i am getting - 

SourabhStreamin_13-1617295412485.png

 

but if i set empty text at this from invokehttp processor - 

SourabhStreamin_14-1617295481249.png

then this error goes away but the api responds with missing api_key and text - 

SourabhStreamin_15-1617295546458.png

 

Somebody pls help, this is eating my head up . thanks in advance 

 

 

1 ACCEPTED SOLUTION

avatar
New Contributor

Hello, 

I got this resolved, the issue was with respect to the format of flowfile being forwarded to the invokehttp proessor. in order to send post body in form type it is necessary that you convert the format of the flowfile as just file, eg , if the flowfile is "package.json" we need to convert that into just "package". from above issue i kept everything same except i just added on attribute in updateattribute processor as shown in below pic - 

SourabhStreamin_0-1617578887261.png

 

 

View solution in original post

1 REPLY 1

avatar
New Contributor

Hello, 

I got this resolved, the issue was with respect to the format of flowfile being forwarded to the invokehttp proessor. in order to send post body in form type it is necessary that you convert the format of the flowfile as just file, eg , if the flowfile is "package.json" we need to convert that into just "package". from above issue i kept everything same except i just added on attribute in updateattribute processor as shown in below pic - 

SourabhStreamin_0-1617578887261.png