'Is it possible to make a x-www-form-urlencoded POST request through InvokeHttp
I just started using Nifi and i would like to know if it's possible to perform a POST with a content-type set to x-www-form-urlencoded. I need to pass these key/values to my request :
grant_type: refresh_token
client_id: myClientId
client_secret: myClientSecret
refresh_token: myRefreshToken
I try to made somethink with the FlowFile Form Data Name property

But the request sended looks like this : 
I would like the key/value like this (sended as Content-type : application/x-www-urlencoded) : 
Solution 1:[1]
When the HTTP Method is POST, dynamic properties with the property name in the form of
post:form:<NAME>, where the will be the form data name, will be used to fill out themultipart form parts.
so, post:form:<NAME> could be used for multipart/form-data
and you want application/x-www-form-urlencoded
format of http body should be parm1=Value1&parm2=Value2
before calling invokeHttp use replaceText with approximately this expression in replacement value:
client_secret=${client_secret:urlEncode()}&client_secret=${client_secret:urlEncode()}&...
then use invokehttp with
Send Message Body = true
Content-Type = application/x-www-form-urlencoded
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | daggett |
