Reputation: 61
I just started using Nifi and 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 make something with the FlowFile Form Data Name
property:
But the request sent looks like this:
I want the key/value like this (sent as Content-type : application/x-www-urlencoded
) :
Upvotes: 1
Views: 1586
Reputation: 28634
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
Upvotes: 3